How to get information about the implementation of the DOM features

DOM implementation

The document.implementation property has information about the implementation of the DOM features. It returns a DOMImplementation object. DOMImplementation.hasFeature tells you the detail.

Example


<!DOCTYPE HTML> 
<html> 
<body> 
<script> 
  var features = ["Core", "HTML", "CSS", "Selectors-API"]; 
  var levels = ["1.0", "2.0", "3.0"]; 
  document.writeln("<pre>"); 
  for (var i = 0; i < features.length; i++) { 
     document.writeln("Checking for feature: " + features[i]); 
     for (var j = 0; j < levels.length; j++) { 
        document.write(features[i] + " Level " + levels[j] + ": "); 
        document.writeln(document.implementation.hasFeature(features[i], 
        levels[j])); <!--  w ww.  j av a 2s . c  o  m-->
     } 
  } 
  document.write("</pre>") 
</script> 
</body> 
</html>

Click to view the demo





















Home »
  Javascript »
    Javascript Reference »




Array
Canvas Context
CSSStyleDeclaration
CSSStyleSheet
Date
Document
Event
Global
History
HTMLElement
Input Element
Location
Math
Number
String
Window