JAVALin 2015-01-05
转载:http://www.tuicool.com/articles/emiEfmz
点一下test按钮 如果不能正确说出弹出的顺序,请看转载链接
<body> <div id="divTest" style="width: 300px;height: 500px;background-color: red;"> <input type="button" value="test" id="test"> </div> <script> document.getElementById("test").addEventListener('click',function(event){ alert('btnTest-true'+event.eventPhase); },true); document.getElementById("divTest").addEventListener('click',function(event){ alert('divTest-false'+event.eventPhase); },false); document.getElementById("divTest").addEventListener('click',function(event){ alert('divTest'+event.eventPhase); },true); document.body.addEventListener('click',function(event){ alert('body'+event.eventPhase); },true); </script> </body>