event.currentTarget与event.target的差别想大家在使用的时候不是非常在意.本文以測试代码来解说它门之间的不同.即,event.currentTarget指向事件所绑定的元素,而event.target始终指向事件发生时的元素.翻译的不专业,好拗口啊,还是直接上測试代码吧:   <div id="wrapper"> <a href="#" id="inner">click here!</a&…
currentTarget始终是监听事件者,而target是事件的真正发出者.…
Flex的 Event中属性currentTarget与target的差别 1.差别 (1)currentTarget是事件的处理对象(event processor) (2)target是事件的调用对象(event dispatcher) 2.实例说明 (1)设计源代码 <? xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com…
event.target 和 event.currentTarget 的区别 举例说明: <!DOCTYPE html> <html> <head> <title></title> <style> div { margin: 1rem; padding: 1rem; } #a {background-color: #f00;} #b {background-color: #0f0;} #c {background-color: #00…
event.target This property of event objects is the object the event was dispatched on. It is different than event.currentTarget when the event handler is called in bubbling or capturing phase of the event. event.currentTarget Identifies the current t…
先上结论: Event.target:触发事件的元素: Event.currentTarget:事件绑定的元素: 通过下面的例子来理解这两个属性的区别: 使用Event.target属性的例子:(我在<body>和<button>上都绑定了click事件) <body onclick="mouseEvent1()"> <button onclick="mouseEvent2()">点我</button> &…
首先本质区别是: event.target返回触发事件的元素 event.currentTarget返回绑定事件的元素…
event.currentTarget指向事件所绑定的元素,而event.target始终指向事件发生时的元素…
<style> * { margin:0; padding:0; list-style:none; } #ul { width:400px; height:250px; margin:0 auto; } </style> </head> <body> <ul id='ul' style='border:1px solid black'>UL <li>LI<a href=''>a</a></li> &…
原文:https://medium.com/@florenceliang/javascript-event-delegation-and-event-target-vs-event-currenttarget-c9680c3a46d1 In this case, at the time you call console.log(e), there's a DOM element in the currentTarget property. But sometime later, that pro…