日期:2014-05-16 浏览次数:20348 次
function checkMobile() { var mobile = document.getElementById("phonenumber").value; var b = false; if (/^13\d{9}$/g.test(mobile) || (/^15[0-35-9]\d{8}$/g.test(mobile)) || (/^18[05-9]\d{8}$/g.test(mobile))) { document.getElementById("errorDiv").innerHTML = "congratulations."; b = true; } else { document.getElementById("errorDiv").innerHTML = "sorry, the phone number is wrong!"; b = false; } return b; }