Cricinfo Live Scores

Tuesday, February 19, 2008

JavaScript Events

JavaScript Events are items that transpire based on an action. A document event is the loading of an HTML document. A form event is the clicking on a button. Events are objects with properties.

Event Properties

  • x -Mouse x coordinate when the event happened.
  • y -Mouse y coordinate when the event happened.

JavaScript defines five types of events which are form, image, image map, link, and window events. Events are associated with HTML tags. The definitions of the events described below are as follows:

Form Events

  • blur - The input focus was lost.
  • change - An element lost the focus since it was changed.
  • focus - The input focus was obtained.
  • reset - The user reset the object, usually a form.
  • select - Some text is selected
  • submit - The user submitted an object, usually a form.

Image Events

  • abort - A user action caused an abort.
  • error - An error occurred.
  • load - The object was loaded.

Image Map Events

  • mouseOut - The mouse is moved from on top a link.
  • mouseOver - The mouse is moved over a link.

Link Events

  • click - An object was clicked.
  • mouseOut - The mouse is moved from on top a link.
  • mouseOver - The mouse is moved over a link.

Window Events

  • blur - The input focus was lost.
  • error - An error occurred.
  • focus - The input focus was obtained.
  • load - The object was loaded.
  • unload - The object was exited.
Author
Kazi Masudul Alam