JavaScript Document Object

Source: Internet
Author: User

Document Object

The 1.document object is a Child of the Window object, can be used directly, and is used to get HTML page elements

2.document Object Properties

A) Alinkcolor activity link Color

b) LinkColor text link color

c) Vlinkcolor User has observed the text color of a document link

d) Cookie information stored on the client by the cookie

i. Some small text files that some Web sites store users ' information on their hard drives

Ii.cookie can record user's user name, password, page visited, time of stay, etc., so as to facilitate the user's operation again .

the information in the Iii.cookie is stored as a "key - value" pair, and its information can only be a character in the URL encoding, if there is a Chinese need to convert the Chinese character, that is, in the client store Cookies can only be information that consists of numbers and letters

      Iv. If you want to delete a cookie, you can modify its date to expire automatically .

3.document Object Methods

A) clear the specified document content -- not recommended

I.docobj.clear ()-- no parameters, no return value

Ii. closing the document flow and then opening the document stream the contents of the document are automatically erased.

b) Close the document flow

I.docobj.close ()-- no parameters, no return value

II. The method is automatically executed when the page is loaded

II. When the Write() method is called to dynamically generate the page,the system waits until the close () method is not

Iv. when the OnLoad event is added to a window , the onload event is not triggered when the close() method is not called

c) Open Document flow

I.docobj.open ([arg])--arg represents the MIME type of the output stream , default text/html; no return value

d) write text to document

I.docobj.write (HTMLSTR)

II. the output stream needs to be closed using close() after the output is finished, otherwise theoutput will be appended when the Write () method is called again

e) Write text to document and wrap

I.docobj.writeln (str)

JavaScript Document Object

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.