饭后一帖,L@_@K <body>
<div id=1>
<table id="tabColors" width="200" border="0" height="100">
<tr>
<td bgcolor="#000000"> </td>
</tr>
</table></div>
<div id=2>
<table width="200" border="0" height="100">
<tr>
<td bgcolor="#000099"> </td>
</tr>
</table></div>
<div id=3>
<table width="200" border="0" height="100">
<tr>
<td bgcolor="#990000"> </td>
</tr>
</table></div>
<input type="submit" name="Submit" value="切换显示顺序" onclick="changetable(2, 0, 1)">
<script type="text/javascript">
<!--
var arrDivs = document.getElementsByTagName("div");
var arrColors = new Array();
for (var i=0; i<arrDivs.length; i++)
{
arrColors[i] = arrDivs[i].firstChild.firstChild.firstChild.firstChild.bgColor;
}function changetable(numFirst, numSecond, numThird)
{
var arrNewSequence = new Array(numFirst, numSecond, numThird);
for (var i=0; i<arrDivs.length; i++)
{
arrDivs[i].firstChild.firstChild.firstChild.firstChild.bgColor = arrColors[arrNewSequence[i]];
}
}
//-->
</script>
</body>
<div id=1>
<table id="tabColors" width="200" border="0" height="100">
<tr>
<td bgcolor="#000000"> </td>
</tr>
</table></div>
<div id=2>
<table width="200" border="0" height="100">
<tr>
<td bgcolor="#000099"> </td>
</tr>
</table></div>
<div id=3>
<table width="200" border="0" height="100">
<tr>
<td bgcolor="#990000"> </td>
</tr>
</table></div>
<input type="submit" name="Submit" value="切换显示顺序" onclick="changetable(2, 0, 1)">
<script type="text/javascript">
<!--
var arrDivs = document.getElementsByTagName("div");
var arrColors = new Array();
for (var i=0; i<arrDivs.length; i++)
{
arrColors[i] = arrDivs[i].firstChild.firstChild.firstChild.firstChild.bgColor;
}function changetable(numFirst, numSecond, numThird)
{
var arrNewSequence = new Array(numFirst, numSecond, numThird);
for (var i=0; i<arrDivs.length; i++)
{
arrDivs[i].firstChild.firstChild.firstChild.firstChild.bgColor = arrColors[arrNewSequence[i]];
}
}
//-->
</script>
</body>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货