jQuery手机号码验证插件:mobilePhoneNumber
jopen
9年前
mobilePhoneNumber 是用于验证和格式化移动电话号码的通用JS库。
$('input.phone-num').mobilePhoneNumber();
You can bind to an event when the user changes the country of the phone number:
$('input.phone-num').bind('country.mobilePhoneNumber', function(e, country) { console.log('The new country code:', country); })
You can find a demo here.
Dependencies:
- jQuery.caret
- Tested on jQuery 1.8.3 and 1.11.1