【js】阻止默认事件

mac2022-06-30  69

ev.preventDefault();

return false;

另:

window.event? window.event.returnValue = false : e.preventDefault();

 

延伸阻止冒泡:

w3c的方法是e.stopPropagation(),IE则是使用e.cancelBubble = true

转载于:https://www.cnblogs.com/LeeHT/p/6244557.html

最新回复(0)