Java Reference
In-Depth Information
indicates
beginning of
HTML document
comments
indicates
beginning of
header section
Web page title
FIGURE 12-9
2. Enter lines 11 through 30 as shown in Figure 12-7 on page 787.
TextPad displays JavaScript code for the user-defined function, validate(),
in the coding window (Figure 12-10). The script is enclosed within HTML
comment tags to hide it from browsers that cannot interpret JavaScript.
indicates script
language used is
JavaScript
HTML comment
tags
JavaScript function
for HTML form
FIGURE 12-10
The head section of the HTML document is complete. Next, the body of the
HTML document is coded. The body of the HTML document, which is enclosed
within <body> </body> beginning and ending tags, includes code for the
majority of what the user sees on the Web page.
HTML Tags and Tag Attributes
Within an HTML document, event handlers also may be included in an
HTML tag, in a manner similar to the attributes mentioned previously. As you
have learned, an event is an action that occurs, typically as a result of a user's
action, such as placing the mouse pointer on an item on the screen and then
clicking a mouse button, or requesting that the browser load a Web page. In
HTML, an event handler associates an event with the JavaScript code that is
performed when the event occurs. An event handler has the general form of
Search WWH ::




Custom Search