我想要一個具有指定標籤名稱的元素的父項。如何使用jquery通過指定的標籤名稱獲取父元素?
示例代碼:
<table>
<tr>
<td>
<input type='button' id='myId' />
</td>
</tr>
</table>
現在,我想是這樣的:
$('#myId').specificParent('table'); //returns NEAREST parent of myId Element which table is it's tagname.
哇,我真的很驚訝如何ü快速回答。我必須等待接受你的答案。 thx;) – 2010-11-15 15:12:24
@rahim asgari〜59秒 - 幸運休息,我猜:)而且,不客氣。 – jensgram 2010-11-15 15:13:42