js阻止事件冒泡

古城微笑少年丶 2022-07-13 00:48 423阅读 0赞
  1. function stopHandler(event){
  2. window.event?window.event.cancelBubble=true:event.stopPropagation();
  3. }
  4. // function clickParent(event) {
  5. // //stopHandler(event);
  6. // alert('parent is click');
  7. // }

发表评论

表情:
评论列表 (有 0 条评论,423人围观)

还没有评论,来说两句吧...

相关阅读