JAVASCRIPT
Events
JavaScript Events
• HTML events are "things" that happen to HTML elements.
• Here are some examples of HTML events:
• An HTML web page has finished loading
• An HTML input field was changed
• An HTML button was clicked
• When JavaScript is used in HTML pages, JavaScript can "react" on these
events.
JavaScript Events
• HTML allows event handler attributes, with JavaScript code, to be added to
HTML elements.
Common HTML Events
Study more events ➔ HTML DOM Event Object (w3schools.com)
onchange Event
• Call a function when a user changes the selected option of a <select>
element:
onmouseover Event
• Call a function when moving the mouse pointer onto an image:
onmousedown and onmouseup Event
• Call a function when pressing a mouse button over a paragraph:
onload Event
• Execute a JavaScript immediately after a page has been loaded:
References
• https://www.w3schools.com
• Learn to Code — For Free — Coding Courses for Busy People (freecodecamp.org)
• JavaScript - Overview | Tutorialspoint
9
Study more Javascript events, ….