From http://www.simonbingham.me.uk/index.cfm/main/post/uuid/creating-a-character-counter-using-jquery-26