set style with :hover javascript

mixer0001

New Member
I understand that the following method is great for setting CSS styles because of browser compatibility.\[code\]element.style.cssText = "color:red;";\[/code\]What I can't do is use \[code\]cssText\[/code\] to apply styles on the \[code\]:hover\[/code\] and \[code\]:focus\[/code\] CSS events.
What do I do instead of this?\[code\]element.style.cssText = ":focus{color:red;}";\[/code\]P.S. Don't mention using javascript events such as \[code\]onmouseover\[/code\] instead of the CSS \[code\]:hover\[/code\] ( It doesn't fit my situation.)
 
Top