HTML | DOM isDefaultNamespace() Method
The DOM isDefaultNamespace() method is used to return boolean true if the specified namespace is default otherwise, it returns boolean false. The URI of the namespace required can be checked using the namespaceURI string.
Syntax:
node.isDefaultNamespace
Return Value: It returns a boolean value true if the namespace is default, otherwise it returns false.
Example: Return DefaultNamespace property.
<!DOCTYPE html> <html> <head> <title> HTML | DOM isDefaultNamespace() Method </title> </head> <body> <h1> <center> Geeks <button onclick="space()"> Press </button> </center> </h1> <h4> Clicking on the 'Press' button will display if the specified namespace is default. </h4> <p id="demo"></p> <script> function space() { // Access and return default namespace property. var d = document.documentElement; var x = d.isDefaultNamespace( document.getElementById("demo").innerHTML = x; } </script> </body> </html> |
Output:
Before clicking on the button:

After clicking on the button:

Note: Internet Explorer8 and earlier versions don’t support this method.
Browser Support: The browsers supported by DOM isDefaultNamespace() method are listed below:
- Google Chrome
- Internet Explorer 9.0
- Firefox
- Opera
- Safari
Recommended Posts:
- HTML | DOM contains() Method
- HTML | DOM removeAttributeNode() Method
- HTML | DOM hasChildNodes() Method
- HTML | DOM blur() Method
- HTML | DOM insertAdjacentText() Method
- HTML | DOM isEqualNode() Method
- HTML | DOM normalizeDocument() Method
- HTML | DOM setAttributeNode() Method
- HTML | DOM renameNode() Method
- HTML | DOM createDocumentFragment() Method
- HTML | method Attribute
- HTML | DOM click() Method
- HTML | DOM createElement() Method
- HTML | DOM getElementsByTagName() Method
- HTML | DOM adoptNode() Method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



