阻止事件冒泡 使用 event.target 的兼容办法

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

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

原文地址:https://www.cnblogs.com/kdiekdio/p/10235503.html