x
 
<!DOCTYPE html>
<html>
<body>
<h1>button form 属性</h1>
<form action="/demo/action_page.php" method="get" id="nameform">
  <label for="fname">名字:</label>
  <input type="text" id="fname" name="fname"><br><br>
  <label for="lname">姓氏:</label>
  <input type="text" id="lname" name="lname">
</form>
<p>下面的按钮位于 form 元素之外,但仍然是表单的一部分:</p>
<button type="submit" form="nameform" value="提交">提交</button>
</body>
</html>