js 判断手机号格式

大江东去,浪淘尽,千古风流人物。故垒西边,人道是,三国周郎赤壁。乱石穿空,惊涛拍岸,卷起千堆雪。*如画,一时多少豪杰。遥想公瑾当年,小乔初嫁了,雄姿英发。羽扇纶巾,谈笑间,樯橹灰飞烟灭。故国神游,多情应笑我,早生华发。人生如梦,一尊还酹江月。--来自奔跑的panda部落,panda每天与您一起进步       
<form action="" method="post"> <input type="text" value="" placeholder="您的姓名" name="name" required="required" maxlength="20" /> <input type="text" value="" placeholder="您的手机" name="tel" required="required" maxlength="11" id="phone" onblur="checkPhone()"/> <div style="clear:both"></div> <div id="" class='send'> <button type="submit" name="submit">提交</button> </div> </form> <iframe width="100%" height="300" src="https://c.runoob.com/iframe/5535" allowfullscreen="allowfullscreen" frameborder="0"></iframe> <script type="text/javascript"> function checkPhone() { var phone = document.getElementById('phone').value; if (!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(phone))) { alert("手机号码有误,请重填"); return false; } } </script>

 

上一篇:C++进阶(一):多重继承与虚继承


下一篇:重磅!Panda Global获悉立陶宛下周将发行区块链数字货币!