JS取出input标签,放到另一个input标签之前,该怎么做??

李傻傻 发布于 2013/06/03 17:02
阅读 2K+
收藏 0
<tr><td id=T1_departem_man >办理人</TD>
<td id=T2_departem_man >
<input name='departem_man' readonly class=textreadonly value='<%=rs_departem_man%>' title=''></td>
<td id=T1_handle_time >办理日期</TD>
<td id=T2_handle_time >
<input name='handle_time' readonly class=textreadonly  value='<%=rs_handle_time%>' title=''></td>

</tr>

像上面的布局好的HTML代码,我想用JS把<input name='departem_man' readonly class=textreadonly value='<%=rs_departem_man%>' title=''>取出来,然后放到<input name='handle_time' readonly class=textreadonly  value='<%=rs_handle_time%>' title=''>前面。该怎么样做呢?

加载中
0
MuBeiBei
MuBeiBei
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title> New Document </title>
</head>

<body>
	<table>
	<tr><td id=T1_departem_man >办理人</TD> 
	<td id=T2_departem_man > 
	<input name='departem_man' readonly class=textreadonly value='<%=rs_departem_man%>' title=''></td> 
	<td id=T1_handle_time >办理日期</TD> 
	<td id=T2_handle_time > 
	<input name='handle_time' readonly class=textreadonly  value='<%=rs_handle_time%>' title=''></td> 
	</tr>
</table>
	<script>
		
		document.getElementById('T2_handle_time').insertBefore(document.getElementById('T2_departem_man').children[0],document.getElementById('T2_handle_time').children[0]);
		document.getElementById('T2_departem_man').innerHTML = '';//如果不需要清除之前的,就注释上。
	</script>
</body>
</html>
李傻傻
李傻傻
非常感谢。可以解决了
返回顶部
顶部