How to use DOM Node IsSupported in JavaScript

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

JavaScript DOM Node isSupported() Method

JavaScript isSupported() method use for check specified feature are supported or not by an specified Node. If Nodes supports feature then its will return true other wise false.

Syntax

node.isSupported(feature, versions)

Example

<html>

<head>

    <script type="text/javascript">

        function myfun() {

            var item = document.getElementsByTagName("input")[0];

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

            x.innerHTML = item.isSupported("Core", "2.0");

        }

    </script>

</head>

<body>

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

    </h1>

    <input id="Text1" type="text" /><br />

    <button onclick="myfun()">

        check</button>

    <p>

        click button to check this feature supports or not by Input</p>

</body>

</html>

 

Output

 

 isSupported.jpg

 

<html>

<head>

    <script type="text/javascript">

        function myfun() {

            var item = document.getElementsByTagName("button")[0];

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

            x.innerHTML = item.isSupported("password", "1.0");

        }

    </script>

</head>

<body>

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

    </h1>

    <button onclick="myfun()">

        check</button>

    <p>

        click button to check this feature supports or not by Input</p>

</body>

</html>

 

Output

 

 isSupport2.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.