<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
   <title>Dynamic HTML, JavaScript: Test auf Browser-Features</title>

   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

   <meta name="description"
      content="&Uuml;bung Dynamic HTML, JavaScript: Test auf Browser-Features.">
   <meta name="keywords" content="HTML, DHTML, DOM">
   <meta name="author" content="Roland Unger">

   <script language="JavaScript" type="text/javascript">
   <!--

   function queryFeature(aForm) {
     var feature=aForm.feature.options[aForm.feature.selectedIndex].value, version;

     if (aForm.version[0].checked) version="";
     if (aForm.version[1].checked) version="1.0";
     if (aForm.version[2].checked) version="2.0";
     if (aForm.version[3].checked) version="3.0";
     if (aForm.version[4].checked) version="4.0";

     if (document.implementation)
        aForm.result.value=document.implementation.hasFeature(feature,version)?'true':'false';
     else aForm.result.value="Der Browser unterst\u00fctzt keine Abfrage von Features.";
   }

   // -->
   </script>
</head>

<body>

<h2>Dynamic HTML, JavaScript</h2>
<h3>Test auf Browser-Features (document.implementation.hasFeature())</h3>

<form name="thisForm" id="thisForm">
<table cellspacing="0" cellpadding="0" border="0">
<tr valign="top">
 <td><strong>Feature</strong></td>
 <td rowspan="2" width="30">&nbsp;</td>
 <td><strong>Version</strong></td>
</tr>
<tr valign="top">
<td>
 <select name="feature" size="5">
    <option value="XML"   selected>XML
    <option value="HTML"          >HTML
    <option value="Views"         >Views
    <option value="StyleSheets"   >StyleSheets
    <option value="CSS"           >CSS
    <option value="CSS2"          >CSS2
    <option value="Events"        >Events
    <option value="UIEvents"      >UIEvents
    <option value="MouseEvents"   >MouseEvents
    <option value="MutationEvents">MutationEvents
    <option value="HTMLEvents"    >HTMLEvents
    <option value="Traversal"     >Traversal
    <option value="Range"         >Range
 </select></td>

 <td><input type="radio" name="version" value="" checked>none<br>
    <input type="radio" name="version" id="version">1.0<br>
    <input type="radio" name="version" id="version">2.0<br>
    <input type="radio" name="version" id="version">3.0<br>
    <input type="radio" name="version" id="version">4.0<br />&nbsp;</td>
</tr>
</table>

<input type="button" value=" = " onClick="queryFeature(thisForm);">
<input type="text" name="result" id="result" value="" size="40">

</form>

</body>
</html>