HTML and CSS Reference
In-Depth Information
Figure 11.3 Document properties: Link turns purple after “thanks.html” has been visited.
Figure 11.4 After the user clicks the link, this page is displayed.
The document Object Methods. The document object has methods to tell the
object how to behave or what to do. Table 11.3 lists these methods. We have used the
write() and writeln() methods throughout this text to send output to the screen dynam-
ically, as shown here:
document.writeln("<h2>Welcome to the JavaScript World!</h1>");
Methods, like properties, use the dot syntax to define the object they are manipulat-
ing; for instance, document.clear() or window.open(). (The parentheses differentiate a
method from a property.)
Table 11.3 Methods of the document Object
Method
What It Does
clear()
Clears the current document window.
close()
Closes the document window for writing.
Continues
 
Search WWH ::




Custom Search