tags:

views:

33

answers:

2

Hi

I have TD Id.But i need to get TR id using TD id .How can i get.

Help me on this.

+2  A: 

The tr is the parent node of the td:

var tableRowId = document.getElementById("id_of_td").parentNode.id;
RoToRa
A: 

TR is TD's parent node, so you need to do:

    var trId=document.getElementById(tdId).parentNode.id;
aularon