JavaScript Events with example

JavaScript Events with example

Here you will learn to code the program of Javascript Events with examples.

 

What are JavaScript events

JavaScript events are actions or occurrences that happen in the browser or on a web page, triggered by users or the browser itself. Here are some common events in JavaScript:

onClick: Occurs when a user clicks on an element.

Load: Occurs when a resource and its dependent resources have finished loading.

onmouseover: Occurs when the mouse pointer is moved onto an element.

onmouseout: Occurs when the mouse pointer is moved out of an element.

Keydown: Occurs when a key is pressed down.

Keyup: Occurs when a key is released.

onkeypress: Triggered when you press a key.

onFocus: Occurs when an element receives focus.

onBlur: Occurs when an element loses focus.

Submit: Occurs when a form is submitted.

Onload– Occurs when the page is loaded.

Onunload– Occurs when the page unload from browser.

 

onload and onunload event

 

 

onClick event

 

 

onfocus and onblur event

 

 

onmouseout and onmouseover event

 

 

onkeypress event

 

 

 

Check out our other JavaScript examples

 

 

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top