
peege0102
|
Tr Trageting In Javascript PLEASE HELP!!!!
Monday, 30th March 2009
I'm trying to write a script so that every time a check box is clicked the entire tr in the table changes color. I wrote this one for targeting a paragraph so that every time its clicked it changes color.
<br>
<br>function init(){
<br>var para = document.getElementsByTagName("p");
<br>for(var p=0; p<para.length; p++){
<br>para[p].onclick = check;
<br>}
<br>}
<br>
<br>function check(){
<br>
<br>paragraph");
<br>if( this.className == "sample3"){
<br>this.className = "";
<br>}else{
<br>this.className = "sample3";
<br>}
<br>}
<br>
<br>and it works I'm just having problems adapting it, Thanks
|