215
CHAPTER
Adding Interactivity and Multimedia 9
8 Type document.
getElement
ById(“?”).style.
visibility =
“hidden”;, replacing?
with the ID you used in
Step 2.
9 Press.
0 Type }.
The function to hide the
content is created.
5 In the script, type
function hideDiv().
6 Press.
7 Type {.
7
5
(^810)
TIPS
Can I set any style sheet property?
Yes. The style object allows you to modify any CSS
property. You could for example change the
background color to red by typing document.
getElementById(“content”).style.
background-color = “FF0000”.
Where can I find more information on
JavaScript’s objects?
You can find a wealth of information on the Web.
Rather than rely on any one particular Web site, you
can use your favorite search engine to find current
details. HTML, XHTML, and CSS: Your visual blueprint
for designing effective Web pages (Wiley, 2008) has a
chapter that covers the topic in more detail as well.