질문 js에서 이벤트 처리기의 속성을 확인하는 방법은 무엇입니까?
<!DOCTYPE HTML>
<html>
<body>
<style type="text/css">
#a {background-color:blue;width:100px;height:200px;}
#b {background-color:red;margin-left:25px;width:50px;height:100px;}
</style>
<div id="a">a
<div id="b">b</div>
</div>
<script>
document.getElementById("a").onclick = function() {console.log("A is clicked");}
document.getElementById("b").onclick = function() {console.log("B is clicked");}
document.onclick = function() {console.log("Document is clicked");}
</script>
</body>
</html>
: 위의 코드에 대한
, 그것은 바로, 그들은 또한 객체, 3 클릭 이벤트 처리기를 등록? 그렇다면 어떻게이 3 개의 핸들러/객체의 속성, 콘솔의 메소드를 확인할 수 있습니까?
을 정확하게 무엇입니까 할/찾으려고? 이 경우 이벤트 핸들러는 단지 함수입니다. 다른 기능과 동일한 속성을가집니다. –