其他分享
首页 > 其他分享> > js 判断手机号格式

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>

 

标签:手机号,js,国周郎,phone,樯橹,江月,格式,panda,故垒
来源: https://www.cnblogs.com/sxdpanda/p/12965623.html