实例方法
preventDefault():终止事件的后续默认操作。
stopPropagation() :阻止当前事件的冒泡行为。
var a=document.getElementById('a');
a.onclick=function(e){
e.preventDefault(); //a链接不会跳转
e.stopPropagation();
}
document.body.onclick=function(){
alert("点击我"); //除了点击a链接,其他任何地方都会弹出
}