当前位置: 首页 > 文档资料 > HTML5 入门教程 >

number

优质
小牛编辑
126浏览
2023-12-01

它只接受数值。 step属性指定精度,默认为1。

例子 (Example)

<!DOCTYPE HTML>
<html>
   <body>
      <form action = "/cgi-bin/html5.cgi" method = "get">
         Select Number : <input type = "number" min = "0" max = "10" step "1"
            value = "5" name = "newinput" />
         <input type = "submit" value = "submit" />
      </form>
   </body>
</html>