- A mouse click
- Mousing over something
- Submitting a form
- Selecting an input field
- A keystroke
- Window scroll
Our button has an onclick event that calls our function eventExample(). Our function calls the alert, which we see when we click the button.
- onclick - when the mouse is clicked
- ondblclick - when the mouse is double-clicked
- onmousedown - when the mouse is pressed down
- onmouseup - when the mouse is released from being pressed
- onmousemove - when the cursor is moved
- onmouseout - when the cursor moves out of element
- onmouseover - when the cursor moves over an element
- onkeydown - when a key is pressed down
- onkeypress - when a key is pressed and released
- onkeyup - when a key is released from being pressed
- onreset - when a form is reset
- onsubmit - when a form is submitted
- onload - when the user opens page
- onunload - when the user leaves page
- onfocus - when an element gains the focus
- onblur - when an element loses the focus
- onchange - when an element's value is changed
Your code will execute in this window.
Let's explore some more tutorials or topics!
Free April 16, 2015, 9:38 p.m."An example of this in action is using events to validate form data before you send it to the server." Tipp: Never validate on client side only before you accept user inputs. You can easilie bypass the client side validation.
Manni Sept. 19, 2013, 5:45 a.m.Hi, I just have a query.Difference between onkeypress and onkeyup .
Prasanth Yerrapragada July 15, 2013, 5:18 a.m.There is a typing error for onclick event explanation in the line Our button has an onlick event that calls our function eventExample(). Our function calls the alert, which we see when we click the button.