Consider the following:
<input type="text" id="foo" />
I need that, when the value of the input.#foo
is changed, without blur, it shot my event. Here comes the problem: I can't use onkey
events because the input is dinamically received by a virtual HTML-composed keyboard.
I can easily do, with the true keyboard:
document.querySelector("#foo").addEventListener('keypress', function() {
// Implementation
});
The W3C recommend using onchange
, but onchange
only works after the blur
event occurs. I need a mix of onkeypress
, to be dynamic, on time modify, and onchange
, to know when it changes. You can see this: http://jsfiddle.net/zuq733La/