HTML | DOM Node isSupported() Method

The isSupported() method in HTML DOM is used to check the specified feature is supported by the specified node or not. This method is not supported by many browsers. It returns true if the feature is supported else it returns false.

Syntax:

node.isSupported(feature, version)

Parameters Used :

  • feature: It is a required parameter and used to defines the feature to check it is supported or not.
  • version: It is an optional parameter which defines the version of the feature to check if is supported.

Below program illustrates the Node isSupported() method in HTML DOM:

Example: This example check if the feature Core, version 2.0, is supported for the <button> element or not.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head
    <title
        HTML DOM Node isSupported() method
    </title
</head>
  
<body>
    <h1>GeeksforGeeks</h1>
      
    <h2>Node isSupported() method</h2>
      
    <p>
        Check feature Core XML DOM Level 2 is
        supported for the button element or not
    </p>
  
    <button onclick = "myGeeks()">
        Click Here!
    </button>
  
    <p id = "GFG"></p>
  
  <script>
      function myGeeks() {
        var item = document.getElementsByTagName("BUTTON")[0];
        var x = item.isSupported("Core", "2.0");
        document.getElementById("GFG").innerHTML = x;
      }
  </script>
</body>
  
</html>   

chevron_right


Output:
Before Click on the button:

After click on the button:

Supported Browsers: The browser supported by Node isSupported() method are listed below:

  • Internet Explorer 9.0
  • Safari


My Personal Notes arrow_drop_up

I am a technology enthusiast who has a keen interest in programming I am pursuing Engineering in Computer Science from GEU, Dehradun I like to unwind by watching movies and English sitcomsI have a keen interest in music

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.




Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.