案例:html/html5 案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<head>
3
<script type="text/javascript">
4
function formSubmit()
5
{
6
document.forms["myForm"].submit();
7
}
8
</script>
9
</head>
10
11
<body>
12
13
<form name="myForm" action="/example/demo_form.aspx" method="get">
14
  First name: <input type="text" name="fname" /><br />
15
  Last name: <input type="text" name="lname" /><br />
16
  <input type="button" onclick="formSubmit()" value="Send form data!" />
17
</form>
18
19
<p>请单击确认按钮,输入会发送到服务器上名为 "demo_form.aspx" 的页面。</p>
20
21
</body>
22
</html>