用jquery 获取一个表格里面第3行第4列的值!
2个回答
2011-06-11
展开全部
<html>
<head>
<script type="text/javascript" src="http://www.w3school.com.cn/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var tt = $("tr:eq(2)>td:eq(3)").css("background-color","red").text();
alert(tt);
});
</script>
</head>
<body>
<hr />
<table width="500" border="0">
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
</tr>
<tr>
<td>11</td>
<td>22</td>
<td>33</td>
<td>44</td>
</tr>
<tr>
<td>111</td>
<td>222</td>
<td>333</td>
<td>444</td>
</tr>
<tr>
<td>5555</td>
<td>6666</td>
<td>7777</td>
<td>8888</td>
</tr>
</table>
</body>
</html>
<head>
<script type="text/javascript" src="http://www.w3school.com.cn/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var tt = $("tr:eq(2)>td:eq(3)").css("background-color","red").text();
alert(tt);
});
</script>
</head>
<body>
<hr />
<table width="500" border="0">
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
</tr>
<tr>
<td>11</td>
<td>22</td>
<td>33</td>
<td>44</td>
</tr>
<tr>
<td>111</td>
<td>222</td>
<td>333</td>
<td>444</td>
</tr>
<tr>
<td>5555</td>
<td>6666</td>
<td>7777</td>
<td>8888</td>
</tr>
</table>
</body>
</html>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询