1. onfocus Events
When the input box gets to the focus, it triggers the event, such as modifying the background color of the input box when it gets to the focus. This feature can actually be defined using CSS's pseudo-class: focus.
2. onblur Events
This with the onfocus event idea, when the input box loses focus, triggers the event, such as changing the input text uniformly to lowercase
3. OnChange Events
The occurrence of this event requires 2 conditions:
- Lose focus
- The content has changed
4. Oninput Events
This time HTML5 the newly added event, IE9 was not supported before the IE9 was used: Onpropertychange event, this event, used to do real-time search function is very suitable. When the content of the input box changes, a real-time trigger event, such as entering a character, or deleting a character, will trigger the occurrence of the event.
5. Example
The event is relatively simple, do not give an example, you can go online for each event, a separate search example!
[Timlinux] Introduction to the Onfocus/onblur/oninput/onchange event of the JavaScript input box