All I want is to display a success message when a user changes the input value. If it starts off as foo and a user types s making foos, I want to display a success message.
What am I missing?
Simple JSFiddle: http://jsfiddle.net/DdyNN/
HTML:
<input type="text" name="foo" id="foo" value="foo">
<div id="bar"></div>
JS:
$('#foo').change(function() {
$('#bar').html('yay!');
});
the change event triggers when you leave the textfield. I would register to the keyup or keydown event.
Links: