在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問(wèn)答/HTML/ input內(nèi)容輸入限制

input內(nèi)容輸入限制

只能輸入數(shù)字:<input type="text" onkeyup="if(!/^d+$/.test(this.value)) {this.value=this.value.replace(/1+/g,'');}" />
類似這樣的,只可輸入數(shù)字并且為整數(shù)小數(shù)點(diǎn)后保留一位 ,謝大佬


  1. d ?
回答
編輯回答
掛念你

var reg = /([0]|[1-9]*).?[0-9]/;
if(!reg.test(this.value)){

return false;

}
[this.value] = reg.exec(this.value);

2018年6月17日 05:54