HTML and CSS Reference
In-Depth Information
Figure 13.16 Three buttons waiting for a user to click one of them.
Figure 13.17 The user clicked the Night button.
13.6.4 Forms and the onFocus and onBlur Event Handlers
The onFocus event handler is triggered when a form element has focus: The cursor is sit-
ting in the box, waiting for key input or in the case of a button, for the Enter key to be
pressed. The onBlur event is triggered when the form element loses focus, when the cur-
sor is moved away from the input device.
<head><title>Using the onFocus Event Handler</title>
<script type="text/javascript">
function handler(message) {
window.status = message;
// Watch the status bar
<body bgcolor="magenta"><b>The onFocus Event Handler
<i>(When you click in one of the boxes, focus goes
to the status bar)</i>
Search WWH ::

Custom Search