Home

Web Browser Events in JavaScript

|
|  Updated:  
2016-03-26 7:38:16
JavaScript Essentials For Dummies
Explore Book
Buy On Amazon

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 element is changed.
keydown A key is pressed down.
keyup A key is released after being pressed.
load A file and its attached files have finished loading.
mousedown A mouse button has been pressed down on an element.
mouseenter A mouse pointer is moved onto the element that has the listener attached.
mouseleave A mouse pointer is moved off the element that has the listener attached.
mousemove A mouse pointer is moved over an element.
mouseout A mouse pointer is moved off the element or one of its children that has the listener attached.
mouseover A mouse pointer is moved onto the element or one of its children that the listener is attached to.
mouseup A mouse button is released over an element.
mousewheel A wheel button of a mouse is rotated.
reset A form is reset.
resize The document has been resized.
scroll The document or an element has been scrolled.
select Text has been selected.
submit A form is submitted.

About This Article

This article is from the book: 

About the book author:

Chris Minnick is an accomplished author, teacher, and programmer. Minnick authored or co-authored over 20 books, including titles in the For Dummies series. He has developed video courses for top online training platforms and he teaches programming and machine learning to professional developers at some of the largest global companies.

Eva Holland is an experienced web developer, tech trainer, and coauthor of Coding with JavaScript For Dummies. She is a co-founder of WatzThis?, a company focused on training and course development.