87,909
社区成员
发帖
与我相关
我的任务
分享
<!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>无标题文档</title>
<script src="http://www.liuxiaofan.com/demo/js/jquery-1.6.4.min.js" type="text/javascript"></script>
</head>
<body>
<table>
<tr>
<TD abbr=Version align=left>
<DIV style="TEXT-ALIGN: left; WIDTH: 50px">V1.0</DIV></TD>
<TD abbr=FileType align=left>
<DIV style="TEXT-ALIGN: left; WIDTH: 60px">.txt</DIV></TD>
<TD abbr=FileSize align=left>
<DIV style="TEXT-ALIGN: left; WIDTH: 60px">2,304.05</DIV></TD>
</tr>
</table>
<script>
var tds = [],abbr = [];
$('table td').each(function(){
tds.push($(this));
abbr.push($(this).attr('abbr'));
})
alert(tds);
alert(abbr);
</script>
</body>
</html>
<!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>无标题文档</title>
<script src="http://www.liuxiaofan.com/demo/js/jquery-1.6.4.min.js" type="text/javascript"></script>
</head>
<body>
<table>
<tr>
<TD abbr=Version align=left>
<DIV style="TEXT-ALIGN: left; WIDTH: 50px">V1.0</DIV></TD>
<TD abbr=FileType align=left>
<DIV style="TEXT-ALIGN: left; WIDTH: 60px">.txt</DIV></TD>
<TD abbr=FileSize align=left>
<DIV style="TEXT-ALIGN: left; WIDTH: 60px">2,304.05</DIV></TD>
</tr>
</table>
<script>
var abbr = '';
$('table td').each(function(){
abbr += $(this).attr('abbr') + ',';
})
alert(abbr);
</script>
</body>
</html>