|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
how can i change attribute of all css classes?
say i have a bunch of divs of a particular class. i want to click a button and change an attribute of that class for all the div instances. how could i do that with javascript?
.myCoolDiv{ background-color:red; } . . . <div class="myCoolDiv">blah</div> <div class="myCoolDiv">more blah</div> < button to change all "myCoolDiv" backgrounds to "blue"> |
|
#2
|
||||
|
||||
|
www.alistapart.com/index.html has a feature on their page where you can alter the display font with a button click. Check out their code for ideas.
wdn2k |
|
#3
|
|||
|
|||
|
they grab all the tags using getElementByTag and just switch out the style sheets. not quite what i was looking for, but might work
|
|
#4
|
|||
|
|||
|
|
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > how can i change attribute of all css classes? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|