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 |
|---|---|---|
| 2340 | 2026. 04. 06. | CSS Anchor Positioning + Popover API 실전 가이드 - JS 없이 툴팁, 드롭다운 만들기 |
| 2325 | 2026. 04. 05. | CSS 2026 네이티브 @mixin, contrast-color(), base-select 실전 가이드 |
| 2304 | 2026. 04. 05. | CSS if() 조건 함수와 Masonry 레이아웃: 2026년 CSS 신기능 실전 적용 |
| 2303 | 2026. 04. 05. | CSS Anchor Positioning 완벽 가이드: JavaScript 없이 툴팁과 드롭다운 만들기 |
| 2278 | 2026. 04. 04. | 2026년 필수 HTML/CSS 신기능: Popover API, Anchor Positioning, Scroll-Driven Animations |
| 2277 | 2026. 04. 04. | CSS Container Queries 실전 가이드: 미디어 쿼리를 넘어서는 반응형 컴포넌트 설계 |
| 2221 | 2026. 02. 11. | HTML Dialog와 Popover API로 모던 모달 구현 |
| 2220 | 2026. 02. 11. | CSS Grid와 Subgrid 레이아웃 마스터하기 |
| 2219 | 2026. 02. 11. | 웹 접근성(A11y) 완벽 가이드 2025 |
| 2218 | 2026. 02. 11. | Web Components와 Shadow DOM 실전 가이드 |