阻止事件冒泡和默认行为

. IE浏览器 非IE浏览器
阻止事件冒泡 event.cancelBubble=true event.stopPropagation()
阻止默认行为 event.returnValue=false event.preventDefault()
区别 一个是设置事件对象方法,一个是设置事件对象属性

猜你喜欢

转载自blog.csdn.net/qq_37860930/article/details/78852217