<form class="form" method="post" id="form" οnsubmit="return checkForm(this)" action="">
电话号码:<input type="text" maxlength="11" name="tel"/>
<button type="submit" name="submit" value="提交"/>
</form>
<script>
function checkForm(o){ var re=/^(13[0-9]{9})|(15[89][0-9]{8})$/; if(!re.test(o.tel.value)){ alert('请输入正确的手机号码。'); return false; }}
</script>