JavaScript form validates the phone number and determines whether an input quantity is a phone number, which is implemented through regular expressions.
The code copy is as follows:
//Check the phone number
function isTel(str){
var reg=/^([0-9]|[/-])+$/g ;
if(str.length<7 || str.length>18){
return false;
}
else{
return reg.exec(str);
}