The user or script moves a window or frame. The user or script resizes a window or frame. The user selects some of the text within a text or textarea field. The user exits a document. General Information about Events JavaScript applications in the browser are largely event-driven.
Events are actions that occur usually as a result of something the user does.
For example, clicking a button is an event, as is changing a text field or moving the mouse over a link. For your script to react to an event, you define event handlers , such as onChange and onClick . If an event applies to an HTML tag, then you can define an event handler for it. For example, the event handler for the focus event is onFocus . To create an event handler for an HTML tag, add an event handler attribute to the tag.