HTML and CSS Reference
EXAMPLE 13.15 ( CONTINUED )
<p>Type your name:
< input type="text"
onFocus="handler('Don\'t forget to enter your name')">
<br />Talk about yourself here:<br />
< textarea name="comments"
onFocus="handler('Did you add comments?')"
rows="5" cols="50">I was born...
A user-defined function called handler() is defined. It takes a string as its only
The string message, “Don't forget to enter your name” (or “Did you add comments?”)
is passed to the function and assigned to the window's status bar. (If you don't see
anything in the status bar, the feature has been disabled for your browser. For
Firefox go to the View option and click Status bar. For Safari, View, and click Hide
The HTML form starts here.
The first input type is a textbox.
The textbox contains the attribute for the onFocus event handler. When this box
has focus, the event will be fired up and call the handler() function.
A text area is defined to hold user comments.
The text area contains the attribute for the onFocus event handler. When this
box has focus, the event will be fired up and call the handler() function. See