$(function(){

$("#username").bind("keyup",isReg);

$("#pwd").bind("keyup",isReg);

})

 

function isReg(){

var reg=/[^\a-\z\A-\Z0-9\_]/g;

var objValue=$(this).val();

objValue=objValue.replace(reg,"");

$(this).val(objValue);

}

相关文章: