trivia: I would suggest use $input.val()>>>0 rather than parseInt here, because parseInt() could be NaN while ">>>0" making it to 0.