2011-04-13 80 views

回答

5

你可能要像

但我不能完全肯定 - 你能澄清或提供一个例子吗?

+0

是的,就是这样。谢谢 – Homam 2011-04-13 11:27:50

1

尝试了这一点:

$('td#id').closest('table') 
2

使用jQuery closest

使用下面的示例代码

<table id="test"> 
    <tr> 
     <td id="one">one</td> 
    </tr> 
</table> 
<table> 
    <tr> 
     <td id="two">two</td> 
    </tr> 
</table> 

$(document).ready(function(){ 

    var table = $("#one").closest('table'); 

}); 

example here