关于$().get() $().each(function(index){}) 选择器的运用
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<style>
.divClass{
border:solid 1px #000000;
width:350px;
height:60px;
background-color:#693;
margin:10px;
}
</style>
<script language="javascript" src="JQ/JQuery.jsp"></script> //JQ引用
<script language="javascript">
$(document).ready(function(e) {
var table=$("table").get(0); //获取其子DOM的第一DOM get()则返回所有的DOM集合
var msg="";
$("tr",table).each(function(index) { //遍历所有的数组内的DOM对象
msg+="第"+(index+1)+"行:";
var cells=$("td",this).get();
var cellcount=cells.length;
for(var i=0;i<cellcount;i++)
{
msg+="第"+(i+1)+"列="+cells[i].innerHTML+" ";
}
msg+="\n";
});
$(".divClass").html(msg).hide().show("slow");
});
</script>
<body>
<table width="561" height="129" border="1">
<tr>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
</tr>
<tr>
<td>21</td>
<td>22</td>
<td>23</td>
<td>24</td>
</tr>
<tr>
<td>31</td>
<td>32</td>
<td>33</td>
<td>34</td>
</tr>
</table>
<div class="divClass"></div>
</body>
</html>