Search code examples
cssinternet-explorerinternet-explorer-6quirks-mode

How do I know if Quirks mode was triggered within IE6?


I read that if the DOCTYPE is not corectly set IE6 will enter Quirks mode.

I have given a document HTML 4.01 Transitional, but how do I know if IE6 triggers Quirks mode or not?


Solution

  • Look at document.compatMode

    <script type="text/javascript" charset="utf-8">
      if(document.compatMode == 'CSS1Compat'){
        alert("Standards mode");
      }else{
        alert("Quirks mode");
      }
    </script>