How I can set a style of a:visited with javascript or jquery. I know how to set with a regular link like
document.getElementById('a12').style.color = '#ff0000';
But I don't know how it work with a:visited?
How I can set a style of a:visited with javascript or jquery. I know how to set with a regular link like
document.getElementById('a12').style.color = '#ff0000';
But I don't know how it work with a:visited?
Style properties adjust style attributes which apply to elements, they completely replace selectors
You have two choices.
e.g.
.foo:visited {
color: #f00;
}
document.getElementById('a12').className += ' foo';
See bobince's answer at http://stackoverflow.com/questions/311052/setting-css-pseudo-class-rules-from-javascript