Fandom

JavaScript Wiki

Document

87pages on
this wiki
Add New Page
Talk0 Share
Line of inheritance:
ObjectNodeDocument
This article is a stub. You can help the JavaScript Wiki by expanding it.
Template:Mainonly
This article relates to both the XML DOM and the HTML DOM; if your document contains HTML (or XHTML), see HTMLDocument.

The most commonly accessed Document instance is Window.document.

MethodsEdit

getElementsByTagNameEdit

Data type function
Return type NodeList
Parameter list tagName (string)
Standard DOM Level 1, DOM Level 2
Documentation Mozilla, Microsoft

Finds every element in the document which has the specified tagName. The asterisk ("*") matches all elements.

See alsoEdit

Element.getElementsByTagName

getElementsByTagNameNSEdit

Data type function
Return type NodeList
Parameter list tagName (string), namespace (string)
Standard DOM Level 2
Documentation Mozilla

Finds every element in the document which has the specified tagName and namespace. If the tagName is only the asterisk ("*"), all elements in the specified namespace will be returned.

getElementByIdEdit

Data type function
Return type Element
Parameter list id (string)
Standard DOM Level 1 HTML, DOM Level 2
Documentation Mozilla, Microsoft (IE8)

Finds the first element in the document which has the specified id. In Internet Explorer 7 or less, returns the first element with the specified name if the id is not found.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.