http://topic.csdn.net/u/20081230/16/a314eaad-1b9d-4b1d-b1f0-1c76281c9be4.html
接分在这里。问题很菜,见笑了。很久没有做编程了,全忘记了。本想用js做合法性验证,点提交有不合法的,就在特定位置提示,可是文字一打印出来就被刷新了,不见了。望大侠帮忙。 
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" import="java.util.*" errorPage="" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<title>24.htm insertAdjacentHTML插入新内容 </title> 
<script language="jscript"> 
function addsome() 

document.all.paral.insertAdjacentHTML("afterBegin"," <h1>在文本前容器内插入内容 </h1>"); 
document.all.paral.insertAdjacentHTML("beforeEnd"," <h2>在文本后容器内插入内容 </h2>"); 
document.all.paral.insertAdjacentHTML("beforeBegin"," <h4>在文本前容器外插入内容 </h1>"); 
document.all.paral.insertAdjacentHTML("afterEnd"," <h5>在文本后容器外插入内容 </h2>"); 

</script> 
</head> 
<body> 
<form id="form1" name="form1" method="post" action=""> 
  <input type="submit" name="Submit" value="提交" onclick="addsome()"/> 
</form> 
<div id="paral" style="fontsize:6;color='#ff00ff'">原来的内容 </div> <hr> 
</body> 
</html>