| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/en-US/docs/Web/API/Node/baseURI | [Back] [Original] |
Get to know MDN better
This feature is well established and works across many devices and browser versions. Its been available across browsers since July 2015.
The read-only baseURI property of the Node interface
returns the absolute base URL of the document containing the node.
The base URL is used to resolve relative URLs when the browser needs to obtain an absolute URL, for example when processing the HTML <img> element's src attribute or the xlink:href or href attributes in SVG.
Although this property is read-only, its value is determined by an algorithm each time the property is accessed, and may change if the conditions changed.
The base URL is determined as follows:
window.location).<Base> element in the document,
the href value of the first Base element with such an attribute is used instead.A string representing the base URL of the Node.
<output>Not calculated</output>
const output = document.querySelector("output");
output.value = output.baseURI;
<base href="https://developer.mozilla.org/modified_base_uri/" />
<output>Not calculated</output>
const output = document.querySelector("output");
output.value = output.baseURI;
| Specification |
|---|
| DOM # ref-for-dom-node-baseuri |
<base> element.This page was last modified on Jul 28, 2023 by MDN contributors.
NodeAbortControllerAbortSignalAbstractRangeAttrCDATASectionCharacterDataCommentCustomEventDOMErrorDOMExceptionDOMImplementationDOMParserDOMTokenListDocumentDocumentFragmentDocumentTypeElementEventEventTargetHTMLCollectionMutationObserverMutationRecordNamedNodeMapNodeIteratorNodeListProcessingInstructionQuotaExceededErrorRangeShadowRootStaticRangeTextTreeWalkerXMLDocumentXPathEvaluatorXPathExpressionXPathResultXSLTProcessorYour blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |