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 |