Is there a library that can extract all text events from an <input type=text>
(or contentEditable -- any one-line input field) element?
In particular, I need to know whenever the text is changed by:
And preferably what it was that changed (whether and what text was inserted, deleted, or replaced).
Needs to work on Chrome, Safari, Firefox 3+, IE9+.
The HTML5 oninput
event is supported by all those browsers and works very much like the onchange
event, but fires as soon as the element's input changes. It also bubbles, so you can capture it further up the document tree.
element.oninput = function () {
}
Working demo: http://jsfiddle.net/Zfthe/
http://whattheheadsaid.com/2010/09/effectively-detecting-user-input-in-javascript
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With