js各類驗證文本框輸入格式

不能爲空 <input οnblur="if(this.value.replace(/^ +| +$/g,'')=='')alert('不能爲空!')"> 只能輸入英文和數字 <input οnblur="if(/[^0-9a-zA-Z]/g.test(value))alert('有錯')"> <input οnkeyup="value=value.replace(/[^0-9a-zA-Z]/g,
相關文章
相關標籤/搜索