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