Javascript Reference - HTML DOM isSupported Method








The isSupported() method checks if a specified feature is supported for the specified node.

Browser Support

isSupported Yes 8.0 Yes Yes Yes

Syntax

node.isSupported(feature, version)

Parameters

Parameter Type Description
feature String Required. the feature name
version String Optional. the version to check




Return Value

It returns a Boolean type, true if the feature is supported, otherwise false.

Example

The following code shows how to check if the feature Core, version 2.0, is supported for the button element.


<!DOCTYPE html>
<html>
<body>
<button onclick="myFunction()">test</button>
<script>
function myFunction()<!--   ww w .j  a va2s.c om-->
{
    var item=document.getElementsByTagName("BUTTON")[0];
    var x=document.getElementById("demo");
    x.innerHTML=item.isSupported("Core","2.0");
}
</script>
</body>
</html>

The code above is rendered as follows: