饭后一帖,L@_@K <body>
  <div id=1>
      <table id="tabColors" width="200" border="0" height="100">
        <tr> 
          <td bgcolor="#000000">&nbsp;</td>
        </tr>
      </table></div>
  <div id=2>
      <table width="200" border="0" height="100">
        <tr> 
          <td bgcolor="#000099">&nbsp;</td>
        </tr>
      </table></div>
  <div id=3>
      <table width="200" border="0" height="100">
        <tr> 
          <td bgcolor="#990000">&nbsp;</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>