html 태그의 onfocus와 onblur 속성이 실행되지 않습니다.
조회수 408회
안녕하세요. focus시 placeholder의 내용을 변경하고 싶어서 코드를 작성했는데요. onfocus와 onblur의 속성이 실행되지 않습니다. 이유가 무엇인가요?
<div contenteditable="true" placeholder="N" onfocus="this.placeholder = 'your'" onblur="this.placeholder = 'N'" /></div>
[contenteditable=true]:empty:before{
content: attr(placeholder);
display: inline-block;
color:black;
}
div[contenteditable=true] {
border: 0;
margin: 0;
padding: 0;
font: unset;
color: unset;
outline: none;
color:black;
display: inline-block;
}
-
(•́ ✖ •̀)
알 수 없는 사용자
댓글 입력