HTML and CSS Reference
Figure 13.3 Using the onSubmit event and return values. If the return value is true
the form is submitted; otherwise, it is stopped.
tag, whereas an event method is applied to an object. Because HTML elements are also
are several methods that can be applied to these objects to simulate events (see
Table 13.2). When an object uses an event method, the method behaves as though the
event has happened; for example, the click() method behaves like the onClick event, the
blur() method behaves like the onBlur event, and so on. 1 The event method is applied to
gram you might see something like the following:
Table 13.2 Event Object Methods
Event Handler It
The Object It Can Affect
Removes focus from windows, frames, form fields.
Simulates a mouse click in form fields (buttons).
Puts focus in a window, frame, form field.
Clears the form fields.
Selects or highlights text in a form field.
Submits a form.
1. Event methods behave as though the event has happened but in themselves do not trigger an event
handler. For example, the click() method does not trigger the onClick event handler.