如何从我当前所在的 td
获取父表标记?
我尝试了 .parents('table')
但它选择了 td
之外的所有表格,我只需要当前的表格
最佳答案
您需要使用closest()
功能:
$('td').closest('table');
关于jquery - 从td中查找父表标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8240039/
标签 jquery html-table
如何从我当前所在的 td
获取父表标记?
我尝试了 .parents('table')
但它选择了 td
之外的所有表格,我只需要当前的表格
最佳答案
您需要使用closest()
功能:
$('td').closest('table');
关于jquery - 从td中查找父表标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8240039/