Click to See Complete Forum and Search --> : Changing a CSS selector using Java Script


Conjurer
11-27-2002, 01:32 PM
I have an <td> with text in it. I have assigned it an id = "link"

I wrote a CSS script declaring the color to be white.

When a user mouses over an image on the page I want to change the CSS code for #link so the color is orange

When they mouse off of the image I want #link to go back to white.

I am blanking out on how to do this -can someone get me started please?

Thanks

Stefan
11-27-2002, 03:13 PM
document.getElementById('link').style.color='#whatever the hexcode for orange is'

noisearchitect
11-27-2002, 03:26 PM
will this work in both internet explorer and netscape navigator? This is actually quite a big topic, so I'm gonna make another separate post for it.

Iain