var capsLockKey = event.keyCode ? event.keyCode : e.which; var shifKey = event.shiftKey ? event.shiftKey:((capsLockKey == 16) ? true : false); if(((capsLockKey >= 65 && capsLockKey <= 90) && !shifKey)||((capsLockKey >= 97 && capsLockKey <= 122) && shifKey)){ return true; }else{ return false; }