Simple instance of js blocking browser default behavior
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <a id="a1" href="http://www.baidu.com">Baidu</a> <script> function stopDefault(e){ //nonIE if(e && e.preventDefault) e.preventDefault(); //IE else window.event.returnValue = false; } window.onload = function(e){ var a1 = document.getElementById("a1"); a1.onclick = function(e){ stopDefault(e); } }; </script> </body></html>The above simple example of js blocking the default behavior of browsers is all the content I share with you. I hope you can give you a reference and I hope you can support Wulin.com more.