126.96.36.199 Form events
17.1 Types of Events | 449
teracting with a form element and has tabbed or clicked to move focus to another element. Form elements respond to keyboard focus changes by firing focus and blur events when they gain and lose the focus.
These form-related events are all covered in more detail in §15.9.3 . A few more notes are in order here, however.
The submit and reset events have default actions that can be canceled by event handlers, and some click events do, too. The focus and blur events do not bubble, but all the other form events do. IE defines focusin and focusout events that do bubble as a useful alternative to focus and blur. The jQuery library (see Chapter 19 ) emulates focusin and focusout events for browsers that do not support them, and the DOM Level 3 Events specification is standardizing them as well.
Finally, note that browsers other than IE trigger an input event onand other text-input form elements whenever the user enters text (via the keyboard or cut-andpaste) into the element. Unlike the change event, these input events are triggered for each insertion. Unfortunately, the event object of an input event does not specify what text has been input. (The new textinput event described later will be a useful alternative to this event.)欢迎转载,转载请注明来自一手册:http://yishouce.com/book/1/31453.html