Virtual Open Schooling Online courses available at Virtual Open Schooling (VOS), for more details kindly click here!
NIOS Silver Jubilee Year
NIOS

Event Handling

From NIOS
Jump to: navigation, search
Previous Page Home Page Next Page
ICT Applications


An event is an action that occurs when a user interacts with a

web page or other browser related activities. For Example: when auser clicks a mouse button or enters data in a form, an event isgenerated. The browser waits for the event to occur, and takes anappropriate action according to the type of event. The action takenby the browser to an event is known as event handling.The function that is executed in response to the event is called anevent handler.

The following figure shows an event and the process of eventhandling:

event handling

Event Handling in JavaScript takes place in two steps:


  1. Defining events such that they are handled by the script.
  2. Connecting these events to JavaScript code.


JavaScript has predefined events for links, images, form elements,windows (a window refers to the body of a document containing HTMLcontent) and event handlers.

The following table structure shows few events, description and the event handlers associated with HTML elements:

event handling

An above example showing the use of Events and Event Handlersassociated with HTML elements:

event handling
Previous Page Home Page Next Page
ICT Applications