clear()

This method is used to clear the current document from the current window or frame. The document.wrtie() and document.writeLn() mthods automatically invoke this method before writing new content to a window or frame.

syntax:

example

This method is used with the following:

document
selection