.trigger("change") not working for some reason
Hi there,
I have a textbox attached to an alert which I want to fire when the textbox value is changed i .e. while the user is typing.
I attempted to use the .change() event handler unsuccessfully. After some searching I found that the .trigger("change") handler should work better but that too is not working.
HTML
-
<label for="textbox1"> this should flash an alert when changed.</label>
<input type="text" id="textbox1" name="textbox1"/>
JAVASCRIPT
-
$('#textbox1').trigger("change", function() {
alert("Changed");
});
I have other jquery / ajax elements on the page that work fine onblur (select boxes) but I really want the textbox to fire on change.
Cheers,
Aaron
Any ideas where I'm going wrong?