How to make type=“number” to positive numbers only

后端 未结 17 2450
既然无缘
既然无缘 2020-11-30 17:12

currently I have the following code


it comes out to something like this

17条回答
  •  余生分开走
    2020-11-30 17:58

    You can use the following to make type="number" accept positive numbers only:

    input type="number" step="1" pattern="\d+"
    

提交回复
热议问题