标签:
如下点击“哈哈哈”的时候只触发f2也就是弹出2,不弹出1
<a onclick=‘f1()‘><div><span onclick="f2(event)">哈哈哈 </span></div>1111111111</a> <script type="text/javascript"> function f1(){ alert(1); } function f2(e){ alert(2); if ( e && e.stopPropagation ) { e.stopPropagation(); } else { window.event.cancelBubble = true; } } </script>
标签:
原文地址:http://www.cnblogs.com/no27/p/4664100.html