<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>测试</title> </head> <script language="javascript"> var t = null; var flag = true; function check(obj) { if (flag) { obj.disabled = flag; flag = false; t = setTimeout(function(){disable(obj)}, 5000); // 5秒间隔 window.open("http://www.baidu.com", "newWindow"); } } function disable(obj) { obj.disabled = flag; flag = true; if (t != null) clearTimeout(t); } </script> <body> <a href="#" onclick="check(this)">ceshi1</a> </body> </html>
?<a href= "http://www.google.com " onclick= "window.open(this.href);document.getElementsByTagName('a')[0].href = 'javascript:void(0)';"> 链接1 </a>
链接disabled =true只显示禁用的效果,但任然可以点<a href="http://www.google.cn" onclick="var that = this; setTimeout(function(){that.href = '###'; that.target=''; that.onclick=function(){ return false; }; });" target="_blank">Open Google in New Window</a>