Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript and CSS classes

Status
Not open for further replies.

aljc

Programmer
Nov 24, 2000
29
GB
hi all,

basically what i want to do is to change the attributes of a class using javascript
for example
.myclass { color: blue }
and there are lots of elements on the page that have class=myclass

Can you do somehting like myclass.color = 'red' to affect all of the elements with that class or do you have to loop through all elements and "manually" change the style attribute(s).

thanks in advance
al
 
thanks Trevman
that was just what i was looking for
great site too!

al
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top