<table width="75%" border="1" style="position:absolute; left:65px; top:134px; width: 342px; height: 79px;" id="t2">
<tr>
<td>t2</td>
<td> </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"> </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;">
<tr>
<td>t2</td>
<td> </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"> </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;">
解决方案 »
- java当关闭时执行一个方法或者java定时执行一个方法
- 执行document.open()与document.close()方法后,对其他javascript函数的影响的问题
- 如何定义<a>标签获得焦点时的样式
- 帮我看看JS 哪里出错了
- Response.Write ("<script language=javascript> javascript:history.go(-1)</script>");能实现这样的功能吗
- <iframe>里的src(即调用的)页面怎样控制其上级页面的对象?谢了!分不多了,搞定再加!
- 关于点击图片的问题
- javascript小问题
- 急,如何给图片加上链接,高手请进!
- ztree单击节点从数据库取数并显示在页面
- 动网论坛上魔法表情是怎样实现的?
- 在一个页面里面我加什么样的脚本才可以禁止右键和ctrl+c键,并且在使用这两种功能时,出现警告框??
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();">
楼主写的好象没有错误啊,只是看的非常不习惯
<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>
一楼的办法是事先有定位,不太符合我的情况。JK_10000(JK)是采用dom方式,非常好!