자바스크립트 onchange 이벤트

(Onchange에서 넘어옴)

1 개요[ | ]

JavaScript onchange Event
자바스크립트 onchange 이벤트
input text 내용 변경 감지
<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 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}