Web pages are much more than just static displays of text and graphics. JavaScript gives web pages interactivity and the ability to perform useful work. An important part of JavaScript’s ability to perform useful functions in the browser is its ability to respond to events.
Here is a list of common events that happen in web browsers that JavaScript can respond to.
Event | Occurs When . . . |
---|---|
abort | The loading of a file is aborted. |
blur | An element has gone out of focus. In other words, the element is no longer the thing that the user is focusing on. |
change | An element’s value has changed since losing and regaining focus. |
click | A mouse has been clicked on an element. |
dbclick | A mouse has been clicked twice on an element. |
error | A file failed to load. |
focus | An element has come into focus. In other words, the element is what the user is currently focusing on. |
input | The value of an or |