HTML ファイルに次のコードがあり、次のコードで td の祖父母であるテーブルのような要素の祖父母にアクセスしたいと考えています。このために、次のjquery構文を使用しましたが、「未定義」と表示されます。誰でも問題がどこにあるのか教えてもらえますか?
<script type="text/javascript">
$(document).ready(function () {
alert($('td[id="4"]').parents().eq(1).attr("id"));
});
</script>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div class="ui-layout-center" id="center" runat="server">
<table id="Table1" >
<tr id="tr1">
<td id="3" class="cell" >
first cell
</td>
<td id="4" class="cell">
second cell
</td>
</tr>
</table>
<br />
<br />
</div>
</form>
</body>
</html>