<!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>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="yixianggao@126.com" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head>
<body>
<div>
<table id="tb">
<tr><td>123</td></tr>
<tr><td>456</td></tr>
<tr><td>789</td></tr>
</table>
</div>
<script type="text/javascript">
<!--
var target = document.getElementById("tb");
var cell;
for (var i=0; i<target.cells.length; i++)
{
cell = target.cells[i];
cell.style.color = "white";
cell.style.backgroundColor = "black";
}
//-->
</script>
</body>
</html>
遍历td
最新推荐文章于 2020-10-16 16:29:16 发布