2024. 5. 14. 10:42
input readonly focus 제거 카테고리 없음2024. 5. 14. 10:42
nput[type=text]가 아래와 같이 읽기전용(readonly)으로 설정이 되어 있더라도 focus가 들어가 커서가 깜박거리는 현상이 있다.
<input type="text" id="contThema" readonly="readonly" placeholder="입력해주세요.">
focus를 제거하고 싶다면 아래와 같이 focus이벤트가 발생하면 blur()함수를 호출한다.
<input type="text" id="contThema" onfocus="this.blur()" readonly="readonly" placeholder="입력해주세요.">