mahya.m.golchi Posted January 13, 2009 Share Posted January 13, 2009 dear all,I want to change the color of visited links with javascript. I know Document.getElementById("linkId").style.color="colorname"; change the color of my link, but I want to change the color of only visited links.help me please, thanks. Link to comment Share on other sites More sharing options...
jeffman Posted January 13, 2009 Share Posted January 13, 2009 You can dynamically alter any stylesheet. Look into insertRule() and the IE version, addRule(). The trick is to add a new rule to the end of the sheet. Because it's at the end, it overrides any earlier declarations. When you want to change it back, simply delete the last rule in the sheet. Style sheets have a length property for this purpose, so you don't have to keep track of indexes yourself. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.