Document Object
The open() method opens an output stream to collect the output from any document.write() or document.writeln() methods.
Once all the writes are performed, the document.close() method causes any output written to the output stream to be displayed.
Note: If a document already exists in the target, it will be cleared. If this method has no arguments, a new window (about:blank) is displayed.
| Parameter | Description |
|---|---|
| MIMEtype | Optional. The type of document you are writing to. Default value is "text/html" |
| replace | Optional. If set, the history entry for the new document inherits the history entry from the document which opened this document |
![]()
The open() method is supported in all major browsers.
Open an output stream, add some text, then close the output stream:
Open an output stream (in a new window; about:blank), add some text, then close the output stream:
Document Object
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $7.95/mo SEO Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| XML Editor - Free Trial! |
| FREE Website BUILDER |
| Free Website Templates Free CSS Templates |
| Make Your Own Website |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|