Welcome 微信登录

首页 / 脚本样式 / JavaScript / jquery禁止输入数字以外的字符的示例(纯数字验证码)

纯数字验证码的时候用到的,整理如下:

复制代码 代码如下:
$("#mobile-vcode").unbind();
$("#mobile-vcode").bind("keyup change",function () {
    $(this).val($(this).val().replace(/D/g,""));
    if($(this).val().length==4){
        /*ajax检测验证码是否正确,正确则激活按钮*/
    }
});