title: AppendChild to iframe in IE
body: <p>Via javascript (a bookmarklet): I need to create an iframe and then add a form to it and then a script that submits the form.</p>
  
  <p>The following works in Chrome, but not in IE:</p>
  
  <pre><code>var i = document.createElement('iframe'); // also give it id = iframe_id
  var frm = document.createElement('form');  // also add inputs and values
  var s = document.createElement('script'); // also add innerHTML that submits form 
  
  document.body.appendChild(i);
  window.frames['iframe_id'].document.getElementsByTagName('body')[0].appendChild(frm);
  window.frames['iframe_id'].document.getElementsByTagName('body')[0].appendChild(s);
  </code></pre>
  
  <p>In IE I get an error: Unable to get property 'appendChild' of undefined or null reference </p>
  
  <p>I tried to append the form and script to the iframe, before adding the iframe to the document:</p>
  
  <pre><code> i.appendChild(frm);
   i.appendChild(s);
   document.body.appendChild(i);
  </code></pre>
  
  <p>I get a weird response in Chrome. The response from the form submit appears in a blocked pop-up (instead of not at all, which I expect). In IE nothing much seems to happen.</p>