87,915
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>获取Table的最后一行Demo</title>
<script src="https://code.jquery.com/jquery-1.12.4.min.js" type="text/javascript"></script>
</head>
<body>
<table id="tbList">
<thead>
<tr>
<th>编号</th>
<th>名称</th>
<th>明细</th>
</tr>
</thead>
<tbody>
<tr id="realRow">
<td>1083</td>
<td>佛山</td>
<td>
<table>
<tbody>
<tr>
<td>张三</td>
<td>李四</td>
</tr>
<tr id="childrenRow">
<td>黄二</td>
<td>黄三</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<script type="text/javascript">
var $lastRow = $("#tbList tr:last");
console.log($lastRow);
</script>
</body>
</html>