x
 
<!DOCTYPE html>
<html>
<body>
<p>
根据浏览器支持:<br>
数值约束会应用到输入字段中。
</p>
<form action="/demo/demo_form.asp">
  数量(1 到 5 之间):
  <input type="number" name="quantity" min="1" max="5">
  <input type="submit">
</form>
<p><b>注释:</b>IE9 及早期版本不支持 type="number"。</p>
</body>
</html>