Special Edition Using HTML 4: JavaScript Keyword Reference

By Rick Darnell

Event Handlers

Event handlers are where JavaScript gets its power. By looking for specific user actions, JavaScript can confirm or act on input immediately, without waiting for server introduction, since user activity within an HTML page is limited to mouse movement and input on form elements.

onBlur  Blurs occur when a select, text or textarea field on a form loses focus. Event handler of select, text, textarea. See EVENT HANDLERS onChange and onFocus.

onChange  A change event happens when a select, text, or textarea element on a form is modified before losing focus. Event handler of select, text, textarea. See EVENT HANDLERS onBlur, onFocus.

onClick  Occurs when an object, such as a button or check box, is clicked. Event handler of button, checkbox, radio, link, reset, submit.

onFocus  A form element receives focus by tabbing to or clicking the input area with the mouse. Selecting within a field results in a select event. Event handler of select, text, textarea. See EVENT HANDLERS onBlur and onChange.

onLoad  A load event is created when Navigator finishes loading a window or all frames within a <frameset> tag. Event handler of window. See onUnload EVENT HANDLER.

onMouseOver  Occurs when the mouse pointer is placed over a link object. To function with the status or defaultStatus properties, the event handler must return true. Event handler of link.

onSelect  A select event is triggered by selecting some or all of the text in a text or textarea field. Event handler of text, textarea.

onSubmit  Triggered by the user submitting a form. The event handler must return true to allow the form to be submitted to the server. Conversely, it returns false to block the form's submission. Event handler of form. See submit OBJECT and METHOD.

onUnload  Occurs when exiting a document. For proper operation, place the onUnload handler in the <body> or <frameset> tags. Event handler of window. See onLoad EVENT HANDLER.

Last Words

On June 26, 1997, a language standard for Internet scripting was announced by ECMA, "an international, Europe-based industry association founded in 1961 and dedicated to the standardization of information and communication systems" (from the ECMA site, which seemed reluctant to divulge just what ECMA stands for). The standard will be known as ECMA-262, or ECMA Script. ECMA Script was derived from Netscape's JavaScript specification.

JavaScript is on its way to standardization.

© Copyright Macmillan Computer Publishing. All rights reserved.

Make a Comment

Loading Comments...

  • Web Development Newsletter Signup

    Invalid email
    You have successfuly registered to our newsletter.
Thanks for your registration, follow us on our social networks to keep up-to-date