On change of the input get input.value.length
input.value.length
Have a go and let us know how you get on.