编辑下面的代码:【加编码】
<html> <head> <script> function formSubmit() { document.forms["myForm"].submit(); } </script> </head> <body> <form name="myForm" action="form_submit.php" method="get"> First name: <input type="text" name="fname"><br> Last name: <input type="text" name="lname"><br><br> <input type="button" onclick="formSubmit()" value="Send form data!"> </form> <p>Notice that the JavaScript in the head section uses the name of the form to specify which form to submit.</p> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂