JavaScript Document Methods

You are Here:

JavaScript Document Methods

The following are the list of document methods available in JavaScript programming.

adoptNode()Transfers a node from another document into the method's document.
caretRangeFromPoint()Returns a Range object for the document fragment under the specified coordinates.
createAttribute()Creates a new attribute node, and returns it.
createCDATASection()Creates a new CDATA section node, and returns it.
createComment()Creates a new comment node, and returns it.
createDocumentFragment()Creates a new empty DocumentFragment.
createElement()Creates the HTML element specified by tagName.
createElementNS()Creates an element with the specified namespace URI and qualified name.
createEvent()Creates an event of the type specified.
createNodeIterator()Returns a new NodeIterator object.
createProcessingInstruction()Generates a new processing instruction node and returns it.
createRange()Returns a new Range object.
createTextNode()Creates a new Text node.
createTreeWalker()Returns a newly created TreeWalker object.
enableStyleSheetsForSet()Enables the style sheets matching the specified name in the current style sheet set, and disables all other style sheets.
getElementsByTagNameNS()Returns a list of elements with the given tag name belonging to the given namespace.
importNode()Imports a node from another document to be inserted into the current document later.
close()Finishes writing to a document, opened with
execCommand()Executes the specified command (bold, italics, indent, etc.) for the selected part of an editable section.
hasFocus()Returns a Boolean value indicates whether the document or any element inside the document has focus.
open()Opens a document for writing.
queryCommandEnabled()Indicates whether or not the specified editor command is enabled by the browser.
queryCommandState()Returns the current state of the specified command.
queryCommandSupported()Indicates whether or not the specified editor command is supported by the browser.
write()Writes a string of text or HTML expressions to a document.
writeln()Writes a text or HTML expressions followed by a whiteSpace character when written to a document and a newline character when written inside <pre> tag.
getSelection()Returns a selection object representing the range of text selected by the user, or the current position of the caret.
elementFromPoint()Returns the topmost Element at the specified coordinates (relative to the viewport).


Hi Developers, we almost covered 97% of JavaScript Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in JavaScript.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author