我想要一个具有指定标签名称的元素的父项。如何使用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