<table width="75%" border="1" style="position:absolute; left:65px; top:134px; width: 342px; height: 79px;"  id="t2">
  <tr> 
    <td>t2</td>
    <td>&nbsp;</td>
  </tr>
</table>
<table width="75%" border="1" style="position:absolute; left:63px; top:33px; width: 211px; height: 79px;"  id="t1">
  <tr> 
    <td width="132">t1</td>
    <td width="195">&nbsp;</td>
  </tr>
</table>
<input type="button" name="Button" value="ex" onClick="var l1=t1.style.left;var l2=t1.style.top;t1.style.left=t2.style.left;t1.style.top=t2.style.top;t2.style.left=l1;t2.style.top=l2;">

解决方案 »

  1.   

    <script>
    function swap()
    {
    var l1=t1.style.left;
    var l2=t1.style.top;
    t1.style.left=t2.style.left;
    t1.style.top=t2.style.top;
    t2.style.left=l1;
    t2.style.top=l2
    }
    </script>
    <input type="button" name="Button" value="ex" onClick="swap();">
    楼主写的好象没有错误啊,只是看的非常不习惯
      

  2.   

    看错了,原来是 qiqunet(瑞旗·广东)  写的:-)
      

  3.   

    <table border="1"  id="t1">
      <tr> 
        <td width="132">t1</td>
        <td width="195"><input value=t1></td>
      </tr>
    </table>
    dddd
    <table border="1"  id="t2">
      <tr> 
        <td>t2</td>
        <td><input value=t2></td>
      </tr>
    </table>
    <input type="button" name="Button" value="ex" onClick="t2.insertAdjacentElement('afterEnd',tempObj);t1.insertAdjacentElement('afterEnd',t2);tempObj.insertAdjacentElement('afterEnd',t1);"><script language=javascript>
    var tempObj= document.createElement("A");</script>
      

  4.   

    谢谢两位大侠的帮助。
    一楼的办法是事先有定位,不太符合我的情况。JK_10000(JK)是采用dom方式,非常好!