The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Change Active Link Color Reply To: Change Active Link Color


Instead of giving the background (and links) a color through JavaScript, I would suggest to give the page body a CSS classname. Then with CSS, you can control pretty much everything on the page by using that classname, something like this:

body.redBackground { background: #ff0000; }
body.redBackground a { color: #ff0000; }

body.blueBackground { background: #0000ff; }
body.blueBackground a { color: #00ff00; }

Naming just for clarity purposes (I’m not a fan of giving classnames with colors).