apt*_*tap 6 html javascript ajax jquery
我有一系列基于部分的幻灯片:
<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>
Run Code Online (Sandbox Code Playgroud)
我需要选择从#first部分的最后一部分中的表中获取最后一行的ID.
我正在使用以下Jquery,回到"未定义"......任何想法?
var lastListItem = $('#first:last-child table>tbody>tr:last').attr("id");
alert(lastListItem);
Run Code Online (Sandbox Code Playgroud)
hun*_*ter 19
$('#first table:last tr:last')
Run Code Online (Sandbox Code Playgroud)
要么:
$('#first tr:last')
Run Code Online (Sandbox Code Playgroud)
http://jsfiddle.net/hunter/QMzHH/
| 归档时间: |
|
| 查看次数: |
30117 次 |
| 最近记录: |