html中如何获取表单的数据?
document.getElementById('b').value
或者
form1.a.value
在页面间传递,<script>function goURL(theform){ var gourl = "456.html";
gourl +="?p="+theform.username.value+"|"+theform.email.value; theform.action = gourl; return true;
}</script><form method=get onsubnit="return goURL(this);
"><input type=text name=username><input type=text name=email><input type=button value=提交
onclick="goURL(this.form)"></form> 在456.html页面用脚本叫URL问号后面的值分割后,再用"|"分割就得到username和email<script>function init(){ var url= document.location.href.split("?")
temp =url.split("|");
alert("UserName="+temp[0]+"\n"+"Email="+temp[1]); }</script><body onload=init()> </body>