日期:2014-05-16 浏览次数:20398 次
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(function(){
$("#abv").click(function(){
alert($("table tr:eq(1) :nth-child(5)").text());//tr下标从0开始,td下标从1开始
});
})
</script>
<input type="button" id="abv" value="测试用按钮"/>
<table border="1" cellspacing="0" cellpadding="0" width="600">
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5.2</td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
</tr>
</table>