20,358
社区成员
发帖
与我相关
我的任务
分享
function Test(){
this.num = function(b){
if (!this.is_number(num)) {
alert('验证失败');
return false;
}};
this.is_number = function(n){
re = /^\d{5,15}$/;
var c=false;
if(re.test(n)){c=true;}
return(c);
}
}
Test(15088888888);
function Test(str){
this.num = function(b){
if (!this.is_number(b)) {
alert('验证失败');
return false;
}else{
alert('验证成功');
return false;
}
};
this.is_number = function(n){
re = /^\d{5,15}$/;
var c=false;
if(re.test(n)){c=true;}
return(c);
}
num(str);
}