HighDots Forums  

Change the style of all my td tags when pressing a button

JavaScript discussion (multi-lingual) JavaScript discussion (alt.comp.lang.javascript)


Discuss Change the style of all my td tags when pressing a button in the JavaScript discussion (multi-lingual) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Brian Bendtsen
 
Posts: n/a

Default Change the style of all my td tags when pressing a button - 08-16-2006 , 03:43 AM






Hi

Im trying to make a function that will change the style of all my td
tags when pressing a button.

So far it looks like this, but it doesnt seem to work:


javascript:
function labelSelect(cID) {
document.getElementsByTagName('td').className = 'label_not_selected';
cID.className = 'label_selected';
}


Stylesheet:
..label_selected {
background-color: #c3c3c3;
}

..label_not_selected {
background-color: #f3f3f3;
}


Any ideas?

/Brian

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.