Javascript的应用制作一个信息调查表并提交有反应的网页
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>信息提交表</title>
<h1 align="center"><font color="red">信息提交表</font><h1>
</head>
<body>
<hr>
<form>
<table>
<table border="2px" width="800px" height="600px" cellpadding="0" cellspacing="0" align="center" bordercolor="#FF0000">
<tr>
<td>用户名:</td>
<td><input type="text" name="mingzhi"value="小缘"></td>
</tr>
<tr>
<td>密码:</td>
<td><input type="password" name="mima"value="888888"></td>
</tr>
<tr>
<td>专业:</td>
<td><input type="text" name="zhuanye"value="计科"></td>
</tr>
<tr>
<td>学号:</td>
<td><input type="text" name="xuehao"value="123456"></td>
</tr>
<tr>
<td>兴趣:</td>
<td><input type="text" name="xingqu"value="唱歌"></td>
</tr>
<tr>
<td colspan="2" align="center"><button onclick="show();">点击显示输入内容</button></td>
</tr>
<table>
</form>
</body>
<script type="text/javascript">
function show(){
var mingzhi=document.getElementsByName("mingzhi");
var mima=document.getElementsByName("mima");
var zhuanye=document.getElementsByName("zhuanye");
var xuehao=document.getElementsByName("xuehao");
var xingqu=document.getElementsByName("xingqu");
var mingzhi=mingzhi[0].value;
var mima=mima[0].value;
var zhuanye=zhuanye[0].value;
var xuehao=xuehao[0].value;
var xingqu=xingqu[0].value;
document.write("名字是:"+mingzhi,"<br/>密码是:"+mima,"<br/>专业是:"+zhuanye,"<br/>学号是:"+xuehao,"<br/>兴趣是:"+xingqu);
}
</script>
</html>