Verify that the phone number is valid

see code

isValidNo : function(mobileNo){
		var v = false;
		if(mobileNo == null || mobileNo == "" || mobileNo.length != 11) {
			return false;
		}
		var myreg = / ^ (((13 [0-9] {1}) | (15 [0-9] {1}) | (17 [0-9] {1}) | (18 [0-9] {1}) | (14 [0-9] {1})) + \ d {8}) $ /;
        if(myreg.test(mobileNo)){
        	v=true;
        }
		return v;
	}

 The above is only suitable for the numbers currently supported by major operators, if you want to add more, you can add it yourself

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326391314&siteId=291194637