Sometimes, you only want a link to a website to be clicked once. How can this problem be solved? The method in step 3 is provided below!
First:
Use js to change href to # And then empty the taget.
<p><a onclick="var that = this;setTimeout(function(){that.removeAttribute('href');that.onclick=that=null;}, 0);return true;" href="http://www.g.cn" target="_blank">Open Google in New Window</a></p>
Open google in new window
Tip: you can modify some code before running it.
Second:
Use js to delete the href attribute after clicking to change the link to text. Compatible with IE6, IE7, IE8, Firefox, opera, Safari, chrome
<p><a onclick="var that = this;setTimeout(function(){that.removeAttribute('href');that.onclick=that=null;}, 0);return true;" href="http://www.g.cn" target="_blank">Open Google in New Window</a></p>
Open google in new window
Tip: you can modify some code before running it.
Third:
Setting href and target values
<p><a onclick="this._clk?(this.href='javascript:;',this.target='_self'):(this._clk=1);" href="http://www.google.cn" target="_blank">Open Google in New Window</a></p>
Open google in new window