Use javascript to determine the phone number and javascript phone number.
When registering many websites, we need to fill in the phone number. I wanted to confuse it, but it still didn't work. I 've always been prompted that it's incorrect. I 've searched a lot on the Internet for regular expressions, I found many errors,
Finally, I wrote a simple but practical
First, the html content
Mobile phone number: <input type = "text" class = "loginuser" placeholder = "Enter your mobile phone number" id = "uid" onblur = "checkPhone () "/> <span id =" uidt "> function checkPhone () {var phone = document. getElementById ('uid '). value; if (! (/^ 1 [34578] \ d {9} $ /. test (phone) {return document. getElementById ('uidt '). innerHTML = 'Enter the correct mobile phone number '; return false;} else {return document. getElementById ('uidt '). innerHTML = 'OK ';}}
In this way, the mobile phone number verification is complete.