I\'m looking for a way to change the CSS rules for pseudo-class selectors (such as :link, :hover, etc.) from JavaScript.
So an analogue of the CSS code: a:hove
a:hove
My trick is using an attribute selector. Attributes are easier to set up by javascript.
css
.class{ /*normal css... */} .class[special]:after{ content: 'what you want'}
javascript
function setSpecial(id){ document.getElementById(id).setAttribute('special', '1'); }
html
...