<button>按钮1</button>
<script>
var btn = document.querySelector("button")
btn.οnclick=function(eve){
console.log("按钮1");
var ev = window.event||eve
// 阻止冒泡 标准浏览器
// ev.stopPropagation()
// 阻止冒泡 IE低版本
// ev.cancelBubble = true
// 兼容
ev.stopPropagation?ev.stopPropagation():ev.cancelBubble=true
}
window.οnclick=function(){
console.log("全局");
}
</script>