Tuesday, October 25, 2011

How to put a visited color on a javascript link?

If the hyperlink has JavaScript code in its href property, then IE7 doesnt keep track (history) of those links. For example, if we have following link in a html page



href=%26quot;javascript:__doPostBack('LinkBut?br>


Though the link is clicked many times, color of the link button is not changing to visited link color.How to put a visited color on a javascript link?dont rely on putting your JS in the href part of the link, instead make it href=%26quot;#%26quot; and put your JS in the onClick event, like this:

%26lt;a href=%26quot;#%26quot; onClick=%26quot;callJSFunction();%26quot;%26gt; a link %26lt;/a%26gt;