document.querySelector("a").onclick = function(e){ var e = e || window.event; // 阻止默认行为 e.preventDefault() // // 在低版本ie中 // // e.returnValue = false // console.log("呵呵"); //return false; }
阻止默认行为
原文:https://www.cnblogs.com/mrxiachongyu/p/14267315.html