无涯教程-HTML5 - number属性函数

68 阅读1分钟

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

<!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>

运行上面代码输出

参考链接

www.learnfk.com/html5/html5…