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
①. Some small text files that some Web sites store users ' information on their hard drives
②.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 ③.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 Chinese characters, that is, the cookie stored in the client can only be a number and letter information
④. 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
①.docobj.clear ()--no parameters, no return value
②. Closing the document flow and then opening the document flow the document content is automatically cleared
b) Close the document flow
①.docobj.close ()--no parameters, no return value
②. The method is automatically executed when the page has finished loading
③. When the Write () method is called to dynamically generate a page, the system waits until the close () method is not
④. When you add an OnLoad event to a window, the OnLoad event is not triggered when the close () method is not called
c) Open Document flow
①.docobj.open ([arg])--arg represents the MIME type of the output stream, default text/html; no return value
d) write text to document
①.docobj.write (HTMLSTR)
②. The output stream needs to be closed using close () after the output is finished, otherwise the output will be appended when the write () method is called again
e) Write text to document and wrap
①.docobj.writeln (str)
JavaScript Document Object