事件冒泡过程中,使用 event.target 来获取最初触发事件的事件源元素。但是老版本的浏览器不支持 event.target,所以需要兼容

阻止事件冒泡:
    标准:event.stopPropagation()
    非标准(IE9之前):event.cancelBubble = true;
    兼容:event.stopPropagation
    ? event.stopPropagation()
    : event.cancelBubble = true;

相关文章:

  • 2021-10-01
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-16
  • 2022-12-23
  • 2022-12-23
  • 2021-12-17
  • 2021-08-29
相关资源
相似解决方案