<script type= "text/javascript" >
function checkTel(tel)
{
var mobile = /^1[3|5|8]\d{9}$/ , phone = /^0\d{2,3}-?\d{7,8}$/;
return mobile.test(tel) || phone.test(tel);
}
alert(checkTel( '13590871234' )); //true
alert(checkTel( '020-12345678' )); //true
alert(checkTel( '1234' )); //false
</script>
08-22
6225
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-31