Document Reference

Next ❯Elements Reference

Used to access and control the document features

  • turned_in_notMethods
    MethodsUsed
    document.addEventListener()To attach an event handler to the document
    document.adoptNode()To adopt a node from another document
    document.cloneNode()To clone a node from current document
    document.close()To close the output stream previously opened with document.open( )
    document.createAttribute()To create an attribute node
    document.createComment()To create a Comment node with the specified text
    document.createDocumentFragment()To create an empty DocumentFragment node
    document.createElement()To create an Element node
    document.createTextNode()To create a Text node
    document.execCommand()To
    document.getElementById()To get the element that has the ID attribute with the specified value
    document.getElementsByClassName()To get a NodeList containing all elements with the specified class name
    document.getElementsByName()To get a NodeList containing all elements with a specified name
    document.getElementsByTagName()To get a NodeList containing all elements with the specified tag name
    document.hasFocus()To check whether the document has focused or not
    document.importNode()To import a node from another document
    document.normalize()To remove empty Text nodes, and joins adjacent nodes
    document.normalizeDocument()To remove empty Text nodes, and joins adjacent nodes
    document.open()To open an HTML output stream to collect output from document.write( )
    document.querySelector()To get the first element that matches a specified CSS selector(s) in the document
    document.querySelectorAll()To get a static NodeList containing all elements that matches a specified CSS selector(s) in the document
    document.removeEventListener()To remove an event handler from the document (that has been attached with the addEventListener( ) method)
    document.renameNode()To rename the specified node
    document.write()To write HTML or JavaScript code to a document
    document.writeln()Same as write( ), but adds a newline character after each statement

  • turned_in_notProperties
    PropertiesUsed
    document.activeElementTo get the currently focused element in the document
    document.anchorsTo get a collection of all <a> elements in the document that have a name attribute
    document.appletsTo get a collection of all <applet> elements in the document
    document.baseURITo get the absolute base URI of a document
    document.bodyTo set/get the document's body (the <body> element)
    document.cookieTo get all name/value pairs of cookies in the document
    document.characterSetTo get the character encoding for the document
    document.doctypeTo get the Document Type Declaration associated with the document
    document.documentElementTo get the Document Element of the document (the <html> element)
    document.documentModeTo get the mode used by the browser to render the document
    document.documentURITo set/get the location of the document
    document.domainTo get the domain name of the server that loaded the document
    document.embedsTo get a collection of all <embed> elements the document
    document.formsTo get a collection of all <form> elements in the document
    document.headTo get the <head> element of the document
    document.imagesTo get a collection of all <img> elements in the document
    document.implementation
    document.inputEncodingTo get the encoding, character set, used for the document
    document.lastModifiedTo get the date and time the document was last modified
    document.linksTo get a collection of all <a> and <area> elements in the document that have a href attribute
    document.readyStateTo get the (loading) status of the document
    document.referrerTo get the URL of the document that loaded the current document
    document.scriptsTo get a collection of <script> elements in the document
    document.styleSheetsTo get a collection of <style> elements and external css files used in the document
    document.strictErrorCheckingTo set/get whether error-checking is enforced or not
    document.titleTo set/get the title of the document
    document.URLTo get the full URL of the HTML document

  • Elements Reference
❮ Prev Web Storage Reference
Next ❯Elements Reference
TryOut Examples"Learn to Explore..!"

TryOut Editor

receipt