I want to fire a javascript event when the text inside the text field changes, whether through user input of text, copying text, or dragging text. I'm having problems with where users drag and drop text from anywhere in the text box.
In the case of dragging text between text fields, in chrome, the change () event is fired once for the text field from which it was dragged, and the second time the text is deleted in the destination text field.
In firefox or IE8, the change event never fires.
Is there a more suitable event that I can listen for for the cross browser to work?
Here is an example
For documentation purposes, here the code I use is copied from jsfiddle above.
HTML
<input value="drag me over there"> <input> <div class="message"></div>
JQuery
$('input').change(function() { $('.message').append('changed<br/>'); });
source share