JavaScript Events
JavaScript Tutorial » JavaScript Events
An event is something that happens when user interact with the web page, such as when he clicked a link or button, entered text into an input box or textarea, made selection in a select box, pressed key on the keyboard, moved the mouse pointer, submits a form, etc
An event handler for the click event is called onclick,similarly an event handler for the load event is called onload,
event handler for the blur event is called onblur, and so on.
Assign a click handler for a button element, we can use onclick attribute, like this
<button type="button" onclick="alert('How are you')">Click Me</button>
</script>
Mouse Events - example
A mouse event is triggered when the user click some element, move the mouse pointer over an element, etc
The Click Event (onclick)
Click event occurs when a user clicks on an element on a web page.
<script>
<button type="button" onclick="alert('You have clicked
a button!');">Click Me</button>
<a href="#" onclick="alert('You have clicked a link!');">Click Me</a>
</script>
Contextmenu Event (oncontextmenu) - example
The Boolean data type can hold only two values: true or false.
Used to store values like yes (true) or no (false), on (true) or off (false).<script>
<button type="button" oncontextmenu="alert('You have right-clicked
a button!');">Right Click on Me</button>
<a href="#" oncontextmenu="alert('You have right-clicked a link!');">Right Click on Me</a>
</script>
Common HTML Events, example
Common HTML Events
Here is a list of some common HTML events:
onclick The user clicks an HTML element
onmouseover The user moves the mouse over an HTML element
onmouseout The user moves the mouse away from an HTML element
onkeydown The user pushes a keyboard key
onload The browser has finished loading the page
JavaScript Events list, listener, input, on. mouse, focus, select, in html, blur, mdn
JavaScript Events - javascript tutorial
This tool makes it easy to create, adjust, and experiment with custom colors for the web.

Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.

Find here examples of creative and unique website layouts.

Find here examples of creative and unique website CSS HTML menu.