How to use DOM Node IsDefaultNamespace in JavaScript

In this article I am going to explain about DOM Node isDefaultNamespace() method in JavaScript.
  • 1580

JavaScript DOM Node isDefaultNamespace() Method

JavaScript isDefaultNamespace() method use for check specified name space id default or not. If namespace is default then it will return true other wise false.

Syntax

isDefaultNamespace(Url Namespace)

Example

<html>

<head>

    <script type="text/javascript">

        function myfun() {

            var mm = document.documentElement;

            var hh = document.getElementById("tst");

            hh.innerHTML = mm.isDefaultNamespace("https://dotnetheaven.com");

        }

    </script>

</head>

<body>

    <h1 id="tst" style="color: Blue">

        click button to check name space is default or not</h1>

    <button onclick="myfun()">

        check</button>

</body>

</html> 

 

Output

 

 isDefault1.jpg

 

<html>

<head>

    <script type="text/javascript">

        function myfun() {

            var mm = document.documentElement;

            var hh = document.getElementById("tst");

            hh.innerHTML = mm.isDefaultNamespace("https://dotnetheaven.com");

        }

    </script>

</head>

<body>

    <h1 id="tst" style="color: Blue">

        click button to check name space is default or not</h1>

    <button onclick="myfun()">

        check</button>

</body>

</html> 

 

Output

 

 isDefault2.jpg

 

You may also want to read these related articles: here
 
Ask Your Question 
 
Got a programming related question? You may want to post your question here
 

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.