title: Accessing DOM after big innerHTML injection
body: <p>I have some code that looks like this</p>
  
  <pre><code>//create a long string of html, which includes a div with id="mydiv"
  someElement.innerHTML = s; //s is the string above
  document.getElementById('mydiv')
  </code></pre>
  
  <p>Now, after I set the innerHTML, it is going to take a while for the browser to actual render the DOM that includes id="mydiv" . So, will the javascript sit and wait for the dom to be properly rendered after the innerHTML injection, or will it move right along and call the getElementById which is now unsafe since the DOM for that id may not be created yet?</p>