码迷,mamicode.com
首页 > 其他好文 > 详细

The differences between capturing and bubbling

时间:2016-05-13 09:11:19      阅读:104      评论:0      收藏:0      [点我收藏+]

标签:

 

HTML DOM addEventListener() Method

 

the same question: bubbling and capturing

 

Syntax

element.addEventListener(eventfunctionuseCapture)
 
  useCapture:
    •   true - The event handler is executed in the capturing phase
    •   false- Default. The event handler is executed in the bubbling phase

 

Test Demo:

  https://jsfiddle.net/kkcodin/L3qo8ocp/

 

The differences between capturing and bubbling

标签:

原文地址:http://www.cnblogs.com/kkcodin/p/5485617.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!