if(input.length==1) code example Example: jquery get the length of input text $('input selector here').val().length