0% found this document useful (0 votes)
5 views9 pages

What Are

Uploaded by

tehseenali552
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views9 pages

What Are

Uploaded by

tehseenali552
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

What

Are
Events?
Tehseen Ali
In JavaScript, events are
actions or occurrences
that happen in the
browser or web page.
These can be triggered
by the user (like clicking a
button), by the browser
(like finishing loading a
page), or by other
elements on the
page.Here's a list of some
commonly used events:
1 Click Event:('click');

Triggered when a mouse


button is pressed and
released on an element.

2 Mouse Over Event:('mouseover');

Triggered when the mouse


cursor enters the area of
an element.
3 Mouse Out Event: (mouseout);

Triggered when the mouse


cursor leaves the area of
an element.

4 Key Down Event:(keydown);

Triggered when a key


on the keyboard is
pressed
5 Key Up Event:(keyup);

Triggered when a key


on the keyboard is
released.

6 Form Submit Event: (submit);

Triggered when a form is


submitted, either by
clicking a submit button
or pressing Enter while in
a form input field.
7 Window Load Event: (load);

Triggered when the entire page


(including all dependent
resources) has finished loading

8 Scroll Event: (scroll);

Triggered when the


user scrolls through a
web page.
9 Input Change Event: (change);

Triggered when the


value of an input
8 element changes (for
text inputs,
checkboxes, radio
buttons, etc.).
Syntex
Getting element by id:
let element = document.getElementById('myButton');

Handeling the event :


element.addEventListener('click', function() {

// Code to handle the click event

});
Follow me to
get more
Information
and tips like
this
Tehseen Ali

You might also like