title: IE testing Javascript "Browser Mode" "Document Mode" Driving me NUTZ! Is it a browser compatibility issue or what is going on
body: <p>Need an intervention here, as I am pretty much losing my mind on this  0_o</p>
  
  <p>I am using IE 9 and am using IE's F12 developer tools, trying to test for IE8.
  I am performing a pretty simple task with JavaScript.</p>
  
  <p>I am grabbing some inner html - using it as a sting for whatever reason.</p>
  
  <p>Like this:</p>
  
  <pre><code>&lt;div id="Some_Container_div"&gt;
  
      &lt;div class="Some_Inner_Div_Class"&gt;sometext&lt;/div&gt;
      &lt;div class="Some_Inner_Div_Class"&gt;sometext&lt;/div&gt;
      &lt;div class="Some_Inner_Div_Class"&gt;sometext&lt;/div&gt;
  
  &lt;/div&gt;
  
  
  &lt;script&gt;
  
  var Div_Contaiers_Inner_Html_As_String = document.getElementById('Some_Container_div').innerHTML;
  
  alert(Div_Contaiers_Inner_Html_As_String);
  
  Array_Of_Divs = Div_Contaiers_Inner_Html_As_String.split("&lt;/div&gt;");
  
  alert(Array_Of_Divs);
  
  &lt;/script&gt;
  </code></pre>
  
  <hr>
  
  <p>The above code properly alerts:
  First:</p>
  
  <pre><code>&lt;div class="Some_Inner_Div_Class"&gt;sometext&lt;/div&gt;&lt;div class="Some_Inner_Div_Class"&gt;sometext&lt;/div&gt;&lt;div class="Some_Inner_Div_Class"&gt;sometext&lt;/div&gt;
  </code></pre>
  
  <p>Then the second alerts the proper array:</p>
  
  <pre><code>&lt;div class="Some_Inner_Div_Class"&gt;sometext,&lt;div class="Some_Inner_Div_Class"&gt;sometext,&lt;div class="Some_Inner_Div_Class"&gt;sometext,
  </code></pre>
  
  <hr>
  
  <hr>
  
  <p>If I now use the developer tools (f12) and switch to "Browser Mode" IE8 and I switch the "Document Mode" also to IE8 the browser now alerts :</p>
  
  <p>First:</p>
  
  <pre><code>&lt;DIV class=Some_Inner_Div_Class&gt;sometext&lt;/DIV&gt;&lt;DIV class=Some_Inner_Div_Class&gt;sometext&lt;/DIV&gt;&lt;DIV class=Some_Inner_Div_Class&gt;sometext&lt;/DIV&gt;
  </code></pre>
  
  <ul>
  <li><strong>Notice the missing quotes now?</strong></li>
  <li><strong>Notice the capitalization of the words 'DIV' now?</strong></li>
  </ul>
  
  <p>And next it alerts the same thing:</p>
  
  <pre><code>&lt;DIV class=Some_Inner_Div_Class&gt;sometext&lt;/DIV&gt;&lt;DIV class=Some_Inner_Div_Class&gt;sometext&lt;/DIV&gt;&lt;DIV class=Some_Inner_Div_Class&gt;sometext&lt;/DIV&gt;
  </code></pre>
  
  <p>So it looks like it is not even splitting the string into an array now - not sure why, like it was not a string anymore.</p>
  
  <p>If I now use the developer tools (f12) and keep "Browser Mode" IE8 and I switch the "Document Mode" also to IE9 - it works fine again....</p>
  
  <p>So thanks so much for confusing me again Bill Gates 0_O </p>
  
  <p>Anyway - so I looked through here for help - I see some people saying you should switch both "Browser Mode" to IE8 and "Document Mode" also to IE8 when testing with developer tools - but I do not see an explanation I understand as to why. and what is the difference if you switch just one or both.</p>
  
  <p>In the mean time:</p>
  
  <ul>
  <li>Can anyone tell me if this is going to work properly in IE8?</li>
  <li>Why it is stripping the quotes out?</li>
  <li>Why is it not creating the array in developer tools testing mode?</li>
  </ul>
  
  <p>Thanks to all : )</p>