JS停止冒泡
function myfn(e){
window.event?window.event.cancelBubble = true : e.stopPropagation();
}
JS阻止默认行为
function myfn(e){
window.event?window.event.returnValue = false : e.preventDefault();
}
JS停止冒泡
function myfn(e){
window.event?window.event.cancelBubble = true : e.stopPropagation();
}
JS阻止默认行为
function myfn(e){
window.event?window.event.returnValue = false : e.preventDefault();
}
本文标题:阻止冒泡,默认事件
本文链接:https://www.haomeiwen.com/subject/lqjsbttx.html
网友评论