BootWiki教程网
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>BootWiki 教程网</title> <script> function formSubmit() { document.forms["myForm"].submit(); } </script> </head> <body> <form action="form_submit.php" method="get" name="myForm"> First name: <input name="fname" type="text"><br> Last name: <input name="lname" type="text"><br><br> <input onclick="formSubmit()" type="button" value="发送表单数据!"> </form> <p>注意,头部的 JavaScript 部分使用了表单的名称来提交指定的表单。</p> </body> </html>
运行结果