简体   繁体   中英

How to Get RowID(TR id) form TD Id

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

Help me on this.

trtd的父节点:

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

TR是TD的父节点,因此您需要执行以下操作:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM