1 <html> 2 <title>form</title> 3 <script type="text/javascript"> 4 function test(){ 5 var f = document.getElementsByTagName("form")[0]; 6 f.action=f.action+"id="+document.getElementById("input").value; 7 alert(f.action); 8 } 9 </script> 10 <body> 11 <form action="ss.do?" method="get"> 12 <input type="text" id ="input"/> 13 <input type="button" value="提交" onClick="test()"> 14 </form > 15 </body> 16 </html>
轉自百度知友---zhou2003737 http://zhidao.baidu.com/question/465627004.htmljavascript