Document object in JavaScript

Source: Internet
Author: User

The Document object is a property of the window and frames objects in JavaScript and is a document that appears in a window or frame. A document that describes the current window or the specified Window object. It contains the content from the document to the.

Usage: Document (current window) or < Window object >.document (Specify window)

Property:

Document.title//sets the document title equivalent to the text defined by the HTML. This property does not accept assignments in Netscape.

Fgcolor refers to the text color that is represented by the Text property of the tag.

BgColor refers to the background color represented by the BgColor property of the tag. Health.hrbfc120.com

LinkColor refers to the connection color represented by the tag's link property.

Alinkcolor refers to the active connection color represented by the ALink property of the tag.

Vlinkcolor refers to the accessed connection color represented by the Vlink property of the tag.

Method: Rl.120hrb.com

Open () Opens the document so that JavaScript can write data to the current location of the document, which is where the JavaScript is inserted. It is usually not necessary to use this method and JavaScript is called automatically when needed.

Write (); Writeln () writes data to the document, which is written as standard document HTML. The difference between writeln () and write () is that writeln () adds a newline after the data is written. This line break is just wrapping in HTML, if it is enough to show the text wrapping, it depends on where the JavaScript is inserted. As in

tag, the line break is also reflected in the document.

Clear () empties the current document.

Close () closes the document and stops writing the data. If you use the WRITE[LN] () or clear () method, be sure to use the close () method to ensure that the changes are displayed. If the document is not fully read, that is, JavaScript is inserted into the document, you do not have to use this method.

Now we have enough knowledge to do the following pop-up update notifications for many sites.

Of course, you can write an HTML file first, and load the file directly in the open () method.

Document object in JavaScript

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.