client side altering of CSS classes

They have: 9 posts

Joined: Feb 2001

Hi All

I am looking for a way to access CSS classes using JavaScript and amend classes' rules.
document.classes.myclass.color = "#ffffff" ?
Should be something to do with DOM, can you drop me a hint?

Thanks.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

you wanna change the color of a class?
I've never done that, but I have for IDs...
id_name.style.color='ffffff'

stupid question, but what's DOM?

They have: 9 posts

Joined: Feb 2001

it's easy for IDs. I am just wondering if it's possible for classes.
DOM - Document Object Model (http://www.w3.org/DOM/)
e.g: document.getElementById('myID').style.fontFamily = "Verdana"
supported by IE5, NN6, new standard.
Should be something like that for classes, I hope.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.