<HTML> <HEAD> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <META NAME="save" CONTENT="history"> <STYLE> .saveHistory { behavior: url(#default#savehistory); } </STYLE> <script> function go(){ location.href = "affirm.html"; } //动态向下拉列表添加值 function add(){ var option = null; var first = document.getElementById("select"); option = document.createElement("option"); option.appendChild(document.createTextNode(document.getElementById("oPersistInput").value)); option.vaule = document.getElementById("oPersistInput").value; option.selected = "selected"; first.appendChild(option); } </script> </HEAD> <BODY> <FORM name=a> input1:<INPUT class="saveHistory" type="text" id="oPersistInput1"> <br> <br> INput2:<INPUT class="saveHistory" type="text" id="oPersistInput"> <br> <INPUT class="saveHistory" type="button" onclick="add()" value="动态添加下拉列表的值"> <br> 选择: <select class="saveHistory" id="select" name="select"> <option value="">-----请选择----</option> </select> <br> <br> <input type="button" value="submit" onclick="go()" value="submit"> <hr> <META NAME="save" CONTENT="snapshot"><br> <STYLE><br> .saveSnapshot {<br> behavior: url(#default#savesnapshot);<br> }<br> </STYLE><br> 这种情况为清空 </FORM> </BODY> </HTML>
?这是输入的第一个页面,也是表单页面
affirm.html 写道
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</HEAD>
<BODY>
<FORM>
要返回前面的表单页面,但数据不丢失
<br>
<input type=button value=Back onclick=history.back()>
<br>
<input type=button value=Back onclick=history.go(-1)>
</FORM>
</BODY>
</HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</HEAD>
<BODY>
<FORM>
要返回前面的表单页面,但数据不丢失
<br>
<input type=button value=Back onclick=history.back()>
<br>
<input type=button value=Back onclick=history.go(-1)>
</FORM>
</BODY>
</HTML>
?