The isSupported()
method checks if a specified feature
is supported for the specified node.
isSupported |
Yes | 8.0 | Yes | Yes | Yes |
node.isSupported(feature, version)
Parameter | Type | Description |
---|---|---|
feature | String | Required. the feature name |
version | String | Optional. the version to check |
It returns a Boolean type, true if the feature is supported, otherwise false.
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: