日期:2014-05-16 浏览次数:20614 次
<div class="a" onclick="doA();"> <span class="b" onclick="doB(event);">BBBB</span> AAAA </div> <script> function doA(){ alert("a") } function doB(evt){ alert("b"); var evt = evt; window.event?evt.cancelBubble=true:evt.stopPropagation(); } </script>
------解决方案--------------------
<div class="a" onclick="doA();"> <span class="b" onclick="doB('ok', event);">BBBB</span> AAAA </div> <script> function doA(){ alert("a") } function doB(s, evt){ alert(s); var evt = evt; window.event?evt.cancelBubble=true:evt.stopPropagation(); } </script>