Hi Everyone,
I have the following function which will highlight a cell when I click it.
tab.onclick=function(){
var td=document.getElementsByTagName("TD"
for(var i=0;i<td.length;i++)
if(td.isSelected)
td.style.backgroundColor='';
var el=event.srcElement;
var colors=['','#009900'];
if(el.tagName=="TD"{
el.isSelected=el.isSelected?0:1;
el.style.backgroundColor=colors[el.isSelected];
}
}
I (almost ;-) understand the function but what I need is a similar function that will highlight the entire row of a table when any cell is clicked.
Thanks for you help.
Cheers
Richard
I have the following function which will highlight a cell when I click it.
tab.onclick=function(){
var td=document.getElementsByTagName("TD"
for(var i=0;i<td.length;i++)
if(td.isSelected)
td.style.backgroundColor='';
var el=event.srcElement;
var colors=['','#009900'];
if(el.tagName=="TD"{
el.isSelected=el.isSelected?0:1;
el.style.backgroundColor=colors[el.isSelected];
}
}
I (almost ;-) understand the function but what I need is a similar function that will highlight the entire row of a table when any cell is clicked.
Thanks for you help.
Cheers
Richard