天天看點

input設定為type=number的問題

在HTML5中,當input的type設定為number時,發現maxlength屬性不好用,是以,需要自己想方法去自己弄,比如其中幾種解決方法:

①<input type="text" pattern="\d{10}">

②<input type="text" pattern="\d" maxlength="10">

繼續閱讀