[thelist] set a:hover props from JS

SBeam sbeam at syxyz.net
Thu Aug 28 10:46:33 CDT 2003


Anyone know if and how one can set the a:hover Style properties from JS? there 
does not seem to be anything like that in the spec
http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/ecma-script-binding.html

I want to do
document.getElementById('foo').style.backgroundColorHover = 'red';
but is there a property for that?

annoyingly, when I set the backgroundColor for a <A> element, it seems to 
override the a:hover background which was set in the CSS. This happens on IE6 
and Moz. So I am looking for a workaround.

thx

-S


More information about the thelist mailing list