在HTML5中,当input的type设置为number时,发现maxlength属性不好用,因此,需要自己想方法去自己弄,比如其中几种解决方法:
①<input type="text" pattern="\d{10}">
②<input type="text" pattern="\d" maxlength="10">
在HTML5中,当input的type设置为number时,发现maxlength属性不好用,因此,需要自己想方法去自己弄,比如其中几种解决方法:
①<input type="text" pattern="\d{10}">
②<input type="text" pattern="\d" maxlength="10">