This course will become read-only in the near future. Tell us at community.p2pu.org if that is a problem.
Participate
JavaScript表单验证电话号码,判断一个输入量是否为电话号码,通过正则表达式实现。 //检查电话号码 function isTel(str){ var reg=/^([0-9]|[\-])+$/g ; if(str.length<7 || str.length>18){ return false; } else{ return reg.exec(str); } }