title: When document.getElementById() doesn't?
body: <p>I have some JavaScript that obtains elements by ID from an HTML document.</p>
  
  <p>In one particular scenario, the document.getElementById(idString) method returns null in IE8 compatibility mode, however the jQuery equivalent works. I need to work out why the native call isn't working.</p>
  
  <p>Here's an example:</p>
  
  <pre><code>var myId = "e_" + someId;
  var myNativeDiv = document.getElementById(myId);
  var myjQueryDiv = $("#" + myId);
  alert(myNativeDiv + " - " + myjQueryDiv); // alerts "null - [Object object]"
  </code></pre>
  
  <p>I've checked that <code>myId</code> is unique in the document.</p>
  
  <p>Any avenues to investigate appreciated.</p>
  
  <hr>
  
  <p>Update - actually, <code>myjQueryDiv</code> is also empty, but I guess jQuery makes it not null. However, the call <code>parentDom.find("#" + myId);</code> does return the correct element, where parentDom is an ancestor of the element I need to find.</p>