HTML DOM namespaceURI property
The namespaceURI DOM property returns the URI of the specified node’s namespace. This property is read-only.
Note: Internet Explorer 8 and earlier versions don’t support this property.
Return value: A string that represents the URI of the node’s namespace, or null if the node isn’t during a namespace.
Syntax:
node.namespaceURI
Example: In this example, we will see the use of the namespaceURI DOM property.
HTML
<!DOCTYPE html> < html > < body > < h1 >GeekforBeginner</ h1 > < h2 >Click On the Button</ h2 > < button onclick = "show()" > Click Here ! </ button > < p id = "uri" ></ p > < script > function show() { let x = document. documentElement.namespaceURI; document.getElementById( "uri").innerHTML = x; } </ script > </ body > </ html > |
Output:
Supported Browsers: The browsers supported by DOM isDefaultNamespace() method are listed below:
- Google Chrome
- Internet Explorer 9.0
- Firefox
- Opera
- Safari
Contact Us