[Go to site: main page, start]

0% found this document useful (0 votes)
6 views2 pages

JavaScript Event Types Explained

The document provides a brief overview of various JavaScript events, including onclick, onsubmit, onfocus, onload, onchange, onkeyup, onmouseover, and onmouseout. Each event is described with its trigger condition and a simple example. These events are essential for handling user interactions and form validation in web applications.

Uploaded by

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

JavaScript Event Types Explained

The document provides a brief overview of various JavaScript events, including onclick, onsubmit, onfocus, onload, onchange, onkeyup, onmouseover, and onmouseout. Each event is described with its trigger condition and a simple example. These events are essential for handling user interactions and form validation in web applications.

Uploaded by

tanusneha456
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

JavaScript Events - Short Answers

1. onclick Event
Triggered when a user clicks an element. Used for actions on click.

Example:
<button >

2. onsubmit Event
Occurs when a form is submitted. Used for form validation.

Example:
<form validate()">

3. onfocus Event
Fires when an element (like input) gains focus.

Example:
<input >

4. onload Event
Fires when the page or image is fully loaded.

Example:
<body >

5. onchange Event
Occurs when the value of an input or select changes.

Example:
<select >

6. onkeyup Event
Fires when a key is released. Useful for real-time input.

Example:
<input >

7. onmouseover Event
Fires when mouse is over an element.

Example:
<div > 8. onmouseout Event
Fires when mouse leaves the element.

Example:
<div >

You might also like