function stopPropagation(e) { e = e || window.event; if(e.stopPropagation) { //W3C阻止冒泡方法 e.stopPropagation(); } else { e.cancelBubble = true; //IE阻止冒泡方法 }}document.getElementById('need_hide').onclick = function(e) { stopPropagation(e);}
本文共 314 字,大约阅读时间需要 1 分钟。
function stopPropagation(e) { e = e || window.event; if(e.stopPropagation) { //W3C阻止冒泡方法 e.stopPropagation(); } else { e.cancelBubble = true; //IE阻止冒泡方法 }}document.getElementById('need_hide').onclick = function(e) { stopPropagation(e);}
转载于:https://my.oschina.net/suconghou/blog/471497