These are the events which are related to different mouse operations. These events triggered when the user click some element, move the mouse pointer over an element, etc.
This event occurs when any elementon the webpage is clicked. The onclick
event handler is used to handle this event.
The following example will show you an alert message when you click on the elements.
This event occurs when the right mouse button is clicked on an element to open the context menu.
The oncontextmenu
event handler is used to handle this event.
The following example will show an alert message when you right-click on the elements.
This event occurs when a user first moves the mouse pointer over an element and then remove it. The onmouseout
event handler is used to handle this event.
The following example will show you an alert message when the mouseout event occurs.
The mouseover event occurs when a user moves the mouse pointer over an element. The onmouseover
event handler is used to handle this event.
The following example will show you an alert message when you place mouse over the elements.
These events are related to keyboard's keys. These events gets triggered when any key is pressed or released.
Here're some most important keyboard events and their event handler.
The keydown event occurs when the user press down a key on the keyboard.
The onkeydown
event handler is used to handle this event.
Note: Try to enter some text inside input box.
The keyup event occurs when the user releases a key on the keyboard.
The onkeyup
handler is used to handle this event.
The following example will show you an alert message when the keyup event occurs.
Note: Try to enter some text inside input box.
This event occurs when a user presses down a key on the keyboard that has a character value associated with it. Keys like Ctrl, Shift, Alt, Esc, Arrow keys, etc. will not generate a keypress event, but will generate a keydown and keyup event.
The onkeypress
event handler is used to handle this event.
The following example will show you an alert message when the keypress event occurs.
Note: Try to enter some text inside input box.
List of color names supported by all browser »
List of character codes to display special character »
List of all language supported by all browser »
List of Country code supported by all browser »