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 >