This article mainly introduces a practical case of jquery verification of mobile phone numbers. it uses regular expressions for verification. if you are interested, you can refer to the verification of mobile phone numbers, we need to know the number segment of the mobile phone number.
// Supported mobile phone numbers: 134 135 136 137 138 139 147 150 151 152 157 158 159 178 182 183 184 187 188
// China Unicom number: 130 131 132 145 155 156 176 186
// Supported by the telecom number Region: 133 153 177 180 181 189
// Mobile operator: 170
Mobile:
2G segment (GSM): 134-139, 150, 151, 152-158;
3G segment (TD-SCDMA): 157, 187, 188, 147.
China Unicom:
2G segment (GSM): 130-132, 155-156;
3G segment (WCDMA): 185, 186.
China Telecom:
Segment 2G (CDMA): 133, 153;
3G segment (CDMA 2000): 180, 189.
You can write a regular expression:Var myreg =/^ (13 [0-9] {1}) | (14 [0-9] {1}) | (17 [0] {1 }) | (15 [0-3] {1}) | (15 [5-9] {1}) | (18 [0-9] {1 })) + \ d {8}) $ /;
First introduce a JQuery framework: