HTML5 – 数字类型
它只接受数字值。step 属性指定精度,默认为 1。
示例
<!DOCTYPE HTML>
<html>
<body>
<form action = "/cgi-bin/html5.cgi" method = "get">
选择数字:<input type = "number" min = "0" max = "10" step "1"
value = "5" name = "newinput" />
<input type = "submit" value = "提交" />
</form>
</body>
</html>