Contents
see List작성일 2020. 11. 29.
HTML 크롬 자동완성 끄기
Chrome 브라우저에서 input 필드의 자동완성 기능을 비활성화하는 방법입니다.
기본 방법
<!-- 방법 1: autocomplete="off" -->
<input type="text" autocomplete="off">
<!-- 방법 2: autocomplete="no" (일부 브라우저) -->
<input type="text" autocomplete="no">
<!-- 방법 3: 새로운 비밀번호 암시 -->
<input type="password" autocomplete="new-password">
form 전체에 적용
<form autocomplete="off">
<input type="text" name="username">
<input type="password" name="password">
<button type="submit">로그인</button>
</form>
Chrome에서 확실하게 끄기
<!-- Chrome은 autocomplete="off"를 무시할 수 있음 -->
<!-- 방법 1: 랜덤 값 사용 -->
<input type="text" autocomplete="nope">
<input type="password" autocomplete="new-password">
<!-- 방법 2: readonly 후 focus시 해제 -->
<input type="text" readonly onfocus="this.removeAttribute('readonly');">
<!-- 방법 3: 숨겨진 더미 필드 -->
<input type="text" style="display:none">
<input type="password" style="display:none">
<input type="text" name="username">
<input type="password" name="password">
autocomplete 속성 값
| 값 | 설명 |
|---|---|
| off | 자동완성 끄기 |
| on | 자동완성 켜기 |
| new-password | 새 비밀번호 (저장 안함) |
| current-password | 현재 비밀번호 |
| one-time-code | 일회용 코드 (OTP) |
| username | 사용자명 |
| 이메일 | |
| tel | 전화번호 |
| name | 이름 |
JavaScript로 제어
// jQuery
$("input").attr("autocomplete", "off");
// Vanilla JS
document.querySelectorAll("input").forEach(function(el) {
el.setAttribute("autocomplete", "off");
});
// 동적으로 생성된 input에도 적용
$(document).on("focus", "input", function() {
$(this).attr("autocomplete", "off");
});
특정 필드별 자동완성
<!-- 주소 자동완성 -->
<input type="text" autocomplete="street-address">
<input type="text" autocomplete="postal-code">
<input type="text" autocomplete="country">
<!-- 신용카드 자동완성 -->
<input type="text" autocomplete="cc-number">
<input type="text" autocomplete="cc-exp">
<input type="text" autocomplete="cc-csc">
CSS로 자동완성 스타일 제거
/* Chrome 자동완성 배경색 제거 */
input:-webkit-autofill {
-webkit-box-shadow: 0 0 0 1000px white inset;
box-shadow: 0 0 0 1000px white inset;
}
input:-webkit-autofill:focus {
-webkit-box-shadow: 0 0 0 1000px white inset;
}html
| No | 작성일 | Title |
|---|---|---|
| 2217 | 2026. 02. 11. | 모던 CSS: Container Queries와 :has() 선택자 실전 활용 |
| 2181 | 2026. 02. 11. | Web Components 실전: Shadow DOM과 Custom Elements |
| 2180 | 2026. 02. 11. | 반응형 이미지 최적화: srcset, picture, 그리고 AVIF |
| 2179 | 2026. 02. 11. | CSS Nesting과 @scope: 네이티브 CSS의 진화 |
| 2178 | 2026. 02. 11. | 웹 접근성(a11y) 실전 체크리스트 2025 |
| 2177 | 2026. 02. 11. | View Transitions API로 SPA 수준의 페이지 전환 |
| 2176 | 2026. 02. 11. | CSS Anchor Positioning: 툴팁과 드롭다운의 혁신 |
| 2175 | 2026. 02. 11. | HTML Dialog 요소와 Popover API 완전 가이드 |
| 2174 | 2026. 02. 11. | CSS Grid Subgrid: 복잡한 레이아웃의 해결사 |
| 2173 | 2026. 02. 11. | :has() 선택자로 JavaScript 없이 인터랙션 구현하기 |