<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://labfile.oss.aliyuncs.com/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("table tr:nth-child(1)").each(function (){
alert($(this).text());
});
});
</script>
</head>
<body>
<table>
<tr><th>id</th><th>name</th><th>age</th></tr>
<tr><td>1</td><td>Persion</td><td>100</td></tr>
<tr><td>2</td><td>Gesion</td><td>200</td></tr>
<tr><td>3</td><td>Adam</td><td>300</td></tr>
</table>
</body>
</html>
想要單獨 100 像下面的
$("table tr td:eq(2)").each(function (){
alert($(this).text());
});
想要100,200,300像下面的
$("table tr").each(function (){
$(this).find("td:eq(2)").each(function (){
alert($(this).text());
});
});
想要name那一列的值eq()裡的值減1