javascript的event对象里这么多target到底有什么区别


我以Firefox为例吧,用以下代码打印event对象

<button id="test">test</button>

<script>
document.getElementById('test').onclick = function (e) {
    console.dir(e);
};
</script>

然后我发现里面有一堆以target为后缀的属性,这些属性之间有什么区别吗,它们分别是

  • target
  • currentTarget
  • originalTarget
  • explicitOriginalTarget

event JavaScript

谏山黄泉秋山澪 11 years, 3 months ago
guagua answered 11 years, 3 months ago

Your Answer