• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 1. Essential JavaScript > Browser Object Properties, Methods, and Event...

Browser Object Properties, Methods, and Events

We’ve seen that the document object refers to the current page, but how do you actually use this object? We’ve already seen one way, which is to use object methods, such as the write method, to write text to the web page. You use a method of an object by giving the object’s name a dot (.) followed by the method name, such as document.write. Here are a few examples of methods:

  • document.write. Writes text to the current web page.

  • document.writeln. Writes a single line to the current web page and skips to the next line.

  • history.go. Navigates the web browser to a location in the browser’s history.

  • window.alert. Displays an alert dialog box.

  • window.open. Opens a new browser window.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint