HTML and CSS Reference
In-Depth Information
2
onLoad event handler to call
scrollColor(); countDown(),
and copyRight() user-defined
functions
Press the
s p a c e b a r
once and then
type onLoad=
“scrollColor();
countDown();
copyRight()” within
the <body> tag. Do
not press the e n t e r key
(Figure 9-15).
do not press ENTER
key after onLoad
event handler
press SPACEBAR
after the semicolon
Figure 9-15
To Associate a User-Defined Function with the OnChange Event
When the user selects an item in the select list (changes the value of the select list), this change triggers the
associated user-defined function loadInfo(). The this.form parameter in the function call sends the values of the
<option> tags to the function. The following step associates the user-defined function loadInfo() with the onChange
event.
1
click to the right of
“Menu”.
Scroll to line 110 and
do not press ENTER
key after entering
event handler
s p a c e b a r
once and then
type onChange=
“loadInfo(this.
form)” within the
<select> tag. Do not
press the e n t e r key
(Figure 9-16).
Press the
enter onChange event
handler to call loadInfo()
user-defined function
Figure 9-16
To Save an HTML File
With the first section of JavaScript code for the Midwest Bridal Expo Web page
complete, you should save the file.
1
Click File on the menu bar, click Save, and then type chapter9-1solution.html in the
File name text box (do not press e n t e r ).
2
Navigate to the storage device and folder (Chapter09\ChapterFiles) where you save your
Data Files and then click the Save button in the Save As dialog box to save the file.
 
Search WWH ::




Custom Search