English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML DOM namespaceURI Property

HTML DOM Element Object

namespaceURIThe read-only property returns the namespace URI of the element; if the element is not in a namespace, it returns null.

Note:The element inherits the namespace of its parent element, so all elements in an XHTML document have the namespace URI 'http://www.w3.org/1999/xhtml.

Syntax:

element.namespaceURI
var x = document.documentElement.namespaceURI;
Test See‹/›

Browser Compatibility

All browsers fully support the namespaceURI property:

Property
namespaceURIYesYesYesYesYes

Technical Details

Return Value:A string representing the URI of the element's namespace; if the element is not in a namespace, it returnsnull
DOM Version:DOM 2Level

Related References

HTML DOM Reference:isDefaultNamespace() method

HTML DOM Element Object