Event to detect HTML5 control change in Webkit / Chrome?

HTML5 gives us some new input elements, for example <input type=number>. This displays (in Chrome) a text field with two loop buttons inside the text field, to increase and decrease the numerical value inside the field.

For a personal hobby project, I use this control. However, I am stuck in one problem:

Is there a way to determine the value being modified using the javascript event? I expected an event to happen onChange, but such luck would not be. In addition, it onClickonly starts when you click on the contents of a text field, and not when you press the cycle buttons.

Any ideas? (except: hey, these are HTML5 Forms, don't expect anything else to work!)

Edit: As mikerobi points out below, the onChange event fires as soon as the element loses focus. Still not quite what I'm looking for, so other comments and suggestions are welcome!

+5
source share
3 answers

Bugreport result: will not be fixed because the event is inputfired when these buttons are clicked. This is part of the HTML5 specification. Thus, the problem is solved, thanks mikerobi sugestion to send a report.

+6
source

The event onChangefires when the window loses focus, but you probably already know that.

HTML5 , , , , .

, Mac Safari , Chrome, , .

+2

$. click() . , , .

+2

All Articles