자바스크립트 onchange 이벤트
by JM note
HTML
<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>