1 개요[ | ]
- JavaScript onchange Event
- 자바스크립트 onchange 이벤트
- input text 내용 변경 감지
- jQuery change 이벤트의 JavaScript 판
html
Copy
<input type="text" value="hello" onchange="bgcolor_yellow(this)" />
<input type="text" value="world" onchange="bgcolor_yellow(this)" />
<script>
function bgcolor_yellow(obj) {
obj.style.backgroundColor = 'yellow';
}
</script>
- → input text의 내용(hello 또는 world)을 바꾸면 배경색이 노란색으로 바뀐다.
2 같이 보기[ | ]
3 참고[ | ]
편집자 223.62.3.107 Jmnote Jmnote bot 218.39.27.46
로그인하시면 댓글을 쓸 수 있습니다.