개발하자/자바스크립트
event.srcElement (이벤트가 발생한 곳의 주소값)
i구야
2015. 2. 14. 12:26
<html>
<head>
<script>
window.onload=function(){
b.onclick=a;
}
function a(){
//b.style.background="red";
//this.style.background="red";
event.srcElement.style.background="red";
}
</script>
</head>
<body>
<input type="button" id="b">
</body>
</html>