The open () method of the html DOM document Object, domdocument

Source: Internet
Author: User

The open () method of the html DOM document Object, domdocument

The open () method can open a new document and erase the content of the current document.

Syntax:

Document. open (mimetype, replace)

Optional. Specifies the type of the document being written. The default value is "text/html ".
Replace is optional. When this parameter is set, the new document inherits historical entries from the parent document.

This method erases the content of the current HTML document and starts a new document. The new document is written using the write () method or writeln () method.

After you call the open () method to open a new document and use the write () method to set the document content, remember to close the document using the close method and force its content to be displayed.

A script or event handle that is part of a covered document cannot call this method, because the script or event handle itself will also be overwritten.

Example:

<Html> Document. open ("text/html", "replace "); Var txt = " 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.