Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Disable a Link

 
preethi venkatarangan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..
I have a href link which is an image & when you click on the image it opens a new browser.now how do i disable &gray out the link after it is clicked once so that it doesnt open a new window/browser again.
[CODE] <a href="javascript:clickLink();"><img align="middle" src="online.gif" border="0"></a>
function clickLink()
{
document.logon.submit();
Thanks
Preethi}
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
clickLink();this.href='javascript:void(0);'

Eric
 
You showed up just in time for the waffles! And this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!