0% found this document useful (0 votes)
10 views2 pages

Fytdrdy 160

The Document interface represents a web page loaded in the browser, serving as an entry point to the DOM tree which includes elements like <body> and <table>. It provides global functionality for obtaining the page's URL and creating new elements, with specific properties and methods varying by document type (HTML, XML, SVG). Key properties include activeElement, body, characterSet, and documentURI, among others, which offer insights into the document's structure and state.

Uploaded by

akarsh160702
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

Fytdrdy 160

The Document interface represents a web page loaded in the browser, serving as an entry point to the DOM tree which includes elements like <body> and <table>. It provides global functionality for obtaining the page's URL and creating new elements, with specific properties and methods varying by document type (HTML, XML, SVG). Key properties include activeElement, body, characterSet, and documentURI, among others, which offer insights into the document's structure and state.

Uploaded by

akarsh160702
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

The Document interface represents any web page loaded in the browser and serves

as an entry point into the web page's content, which is the DOM tree.

The DOM tree includes elements such as <body> and <table>, among many others.
It provides functionality globally to the document, like how to obtain the page's URL
and create new elements in the document.

EventTargetNodeDocument

The Document interface describes the common properties and methods for any kind
of document. Depending on the document's type (e.g. HTML, XML, SVG, …), a larger
API is available: HTML documents, served with the "text/html" content type, also
implement the HTMLDocument interface, whereas XML and SVG documents
implement the XMLDocument interface.

Constructor

Document()

Creates a new Document object.

Instance properties

This interface also inherits from the Node and EventTarget interfaces.

Document.activeElement Read only

Returns the Element that currently has focus.

Document.adoptedStyleSheets

Add an array of constructed stylesheets to be used by the document. These


stylesheets may also be shared with shadow DOM subtrees of the same document.

Document.body

Returns the <body> or <frameset> node of the current document.

Document.characterSet Read only

Returns the character set being used by the document.

Document.childElementCount Read only

Returns the number of child elements of the current document.

Document.children Read only

Returns the child elements of the current document.

Document.compatMode Read only

Indicates whether the document is rendered in quirks or strict mode.

Document.contentType Read only

Returns the Content-Type from the MIME Header of the current document.

Document.currentScript Read only

Returns the <script> element whose script is currently being processed and isn't a
JavaScript module.
Document.doctype Read only

Returns the Document Type Definition (DTD) of the current document.

Document.documentElement Read only

Returns the Element that is a direct child of the document. For HTML documents, this
is normally the HTMLHtmlElement object representing the
document's <html> element.

Document.documentURI Read only

Returns the document location as a string.

Document.embeds Read only

Returns an HTMLCollection of the embedded <embed> elements in the document.

Document.featurePolicy Experimental Read only

Returns the FeaturePolicy interface with the feature policies applied to the document.

You might also like