【发布时间】:2012-10-08 17:44:25
【问题描述】:
我有一系列基于部分的幻灯片:
<div id="slides">
<section id="first">
<section>
<table>
<thead>
</thead>
<tbody>
<tr id="somethingUnique">
...
</tr>
</tbody>
</table>
</section>
<section>
<table>
<thead>
</thead>
<tbody>
<tr id="somethingUnique">
...
</tr>
</tbody>
</table>
</section>
...
</section>
</div>
我需要从#first section的最后一个部分的表格中选择抓取最后一行的ID。
我正在使用以下 Jquery,返回“未定义”...有什么想法吗?
var lastListItem = $('#first:last-child table>tbody>tr:last').attr("id");
alert(lastListItem);
【问题讨论】:
-
我创建了一个fiddle,它似乎返回了
somethingUnique
标签: javascript jquery html ajax