Open In App

HTML DOM namespaceURI property

Last Updated : 21 Jun, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

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>GeekforGeeks</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

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads