0% found this document useful (0 votes)
1 views1 page

JavaScript Events

JavaScript events are actions like mouse clicks and key presses that can be detected by JavaScript. Common events include onclick, onmouseover, onkeydown, and onload. An example is provided showing how to use an event listener for a button click that triggers an alert.

Uploaded by

virajgadhe07
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)
1 views1 page

JavaScript Events

JavaScript events are actions like mouse clicks and key presses that can be detected by JavaScript. Common events include onclick, onmouseover, onkeydown, and onload. An example is provided showing how to use an event listener for a button click that triggers an alert.

Uploaded by

virajgadhe07
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/ 1

JavaScript Notes - By ChatGPT

JavaScript Events

JavaScript events are actions that can be detected by JavaScript, such as a mouse click, key press, or form

submission.

Common Events:

- onclick: Triggered when an element is clicked.

- onmouseover / onmouseout: When the mouse enters or leaves an element.

- onkeydown / onkeyup: When a key is pressed or released.

- onload: When the page or image has finished loading.

Example:

document.getElementById("btn").addEventListener("click", function() {

alert("Button clicked!");

});

You might also like