• Tutorials Logic, IN
  • +91 8092939553
  • info@tutorialslogic.com

JavaScript Events

Events

Events are action that can be detected by JavaScript. Every element on a web page has certain events which can trigger a javascript.

  • When a user clicks the mouse.
  • When the mouse moves over an element.
  • When a user press any key.
  • When a web page has finished loading.
  • When a image has finished loading.
  • When an input field is changed.
  • When a HTML form is submitted.
Mouse EventDescription
Mouse EventDescription
onclickThis event occurs when the user clicks on an any element.
ondblclickThis event occurs when the user double-clicks on an any element.
onmouseenterThis event occurs when the mouse pointer moves onto an element.
onmouseleaveThis event occurs when the mouse pointer moves out of an element.
onmouseoverThis event occurs when the mouse pointer is moved onto an element or its children.
onmouseoutThis event occurs when the mouse pointer is moved out of an element or its children.
onmouseupThis event occurs when the user releases a mouse button while over an element.
onmousedownThis event occurs when the user presses a mouse button over an element.
onmousemoveThis event occurs when the mouse pointer is moving while it is over an element.
oncontextmenuThis event occurs when the user right-clicks on an element to open a context menu.
Keyboard EventDescription
onkeyupThis event occurs when the user releases a key.
onkeydownThis event occurs when the user is pressing a key down.
onkeypressThis event occurs when the user presses a key on the keyboard.
Form EventDescription
onblurThis event occurs when the user releases a key.
onchangeThis event occurs when the user is pressing a key down.
onfocusThis event occurs when the element gets focus.
onfocusinThis event occurs when an element is about to get focus.
onfocusoutThis event occurs when the element is about to lose focus.
oninputThis event occurs when the user input on an element.
onsearch
onselect
onsubmit
onreset
oninvalid