js Document Object Properties and Methods

document.writeln () is equivalent to the write () method, except that after each writing a newline expression.
document.scripts return a collection of all script pages.
document.title returns the title of the current document.
document.URL return documents complete the URL of
document.referrer return load current document of the document URL.
document.querySelector () Returns the specified document that match the first element of CSS selectors
document.querySelectorAll () document.querySelectorAll () is a new method introduced HTML5, return the document matching CSS selectors node list all elements
document .readyState return the document states (Loading ......)
document.normalize () eliminates empty text nodes and adjacent nodes connected
document.links return of all documents referenced in the Area and Link objects. calculating a set of links and labels <a href=""> <area> tag.
document.inputEncoding returns encoding used for the document (when parsing). (ie8 do not support)
document.lastModified return date and time the document was last modified.
document.importNode (node, deep) to a node copied from the document to another document for application. (Ie8 do not support)
document.images returns a reference to document all Image objects.
document.forms return all Form object references in the document.
document.getElementsByClassName () returns all elements in the document specifies the class name of the collection, as NodeList object. (Ie8 do not support
document.documentElement return the document root
document.documentMode return for rendering documents via the browser mode, only supports IE
the document.domain returns the domain of the current document.)
Document.cookie Sets or returns related to the current document All cookie.
document.createAttribute () creates an attribute node
document.createComment () createComment () method to create a comment node.
document.createElement () creates an element node.
document.createTextNode () to create a text node.
document.doctypeReturns the Document Type Declaration (DTD) associated with the document.
document.adoptNode (node) to return to the current node adapded document from another document. adoptNode () method for obtaining a document from another node.
Node can be any node type.
Note: All nodes child nodes will get to.
Note: The node and its children will then delete the source document.
Tip: Use document.importNode () method to copy a node, but the original document node is not deleted. .
Tip: Use element.cloneNode () method to copy a document of the current node, and the node is not deleted.
document.anchors returns a reference to document all Anchor objects. tag includes a name attribute
document.activeElement returns the current focus element acquires

       if (document.removeEventListener) {         // 所有浏览器,除了 IE 8 及更早IE版本
            document.removeEventListener("mousemove", myFunction);
            //document.addEventListener("mousemove",myFunction)
        } else if (document.detachEvent) {         // IE 8 及更早IE版本
            document.detachEvent("onmousemove", myFunction);
            document.attachEvent("onmousemove", myFunction)
        }

Guess you like

Origin blog.csdn.net/qwe435541908/article/details/84847737