Skip to content
Advertisement

Giving class to an object

I have a few variables with colors that I want to change later. I want certain class to have background color from that variable. Every object with that class should be that color (nav, footer etc.). I have something like this, but it doesn’t work. Can you help?

JavaScript

Advertisement

Answer

in fact I didn’t see any problem, but you can also coding that this way

JavaScript
JavaScript

, how can I modify it so for example class nhcp1txt will make text nhcp1 color (of course I want previous background color too, I want to add another class)?

this way :

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement