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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with row selection

Status
Not open for further replies.

rhowes

IS-IT--Management
Jun 6, 2001
140
ZA
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==&quot;TD&quot;){
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top