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!
source
share