The Document object is an instance of documenthtml and a property of the Window object, so you can access the Document object as a global object.
The child node of the document node can be documenttype,element,processinginstruction or comment. The ProcessingInstruction object can represent processing instructions. This infrequently used interface represents a processing instruction (or PI) in an XML document. The programmer who uses the HTML document does not encounter the ProcessingInstruction node, so there is no more introduction, DocumentType we can access his information through the DOCTYPE property. Comment, as a comment, said no more, just say the element.
1.html Elements and Body elements
Document.documentelement to get the HTML element, document.body to get the BODY element.
2. Documentation Information
Document.title gets the document title.
Document. The URL property contains the full URL of the page such as: {protocol}://{user name}:{password}@{hostname}:{port number}/{path}/{file}? Parameters
The Document.domain property includes only the domain name of the page.
The Document.referrer property is the page from which to jump to the current page.
3. Get elements
1) getElementById ();
2) getElementsByTagName ();
3) Getelementsbyname ();
4) Getelementsbyclassname ();
5) Queryselector (); Gets a single element, () can be a standard form of CSS selector compatible to CSS2.
6) Queryselectorall (); Gets the collection of elements, () can be the standard form of CSS selectors compatible to CSS2.
4. Special Collections
1) document.anchors: Contains all <a> elements of the document with the same characteristics.
2) Document.forms: Contains all the elements in the document, with the same result as document.getelementbytagname ("form").
3) Document.images: Contains all the elements in the document, with the same result as Document.getelementbytagname ("img").
4.document.links: Contains all the <a> elements in the document with the HREF attribute.
5. Document Writing
1) write (): Write as-is.
2) Writeln (): Adds a line break at the end of the string.
3) Open (): Opens the output stream of the Web page.
4) Close (): Closes the output stream of the Web page.
Summary of the document node in JS