title: Insert HTML into iframe
body: <p>I am creating a in browser HTML editor.  I am using the syntax highlighter called Code Mirror which is very good.</p>
  
  <p>My setup is an iframe that holds a view of the page which is being edited and a textarea which the plain text HTML sits which the user edits.</p>
  
  <p>I am trying to insert the edited HTML from the textarea into the iframe which displays they rendered HTML.</p>
  
  <p>Is this possible? I have tried the following:</p>
  
  <p>HTML setup:</p>
  
  <pre><code>&lt;iframe id="render"&gt;
  
  &lt;/iframe&gt;
  
  &lt;textarea id="code"&gt;
  HTML WILL BE 
  
  HERE
  &lt;/textarea&gt;
  &lt;input type="submit" id="edit_button" value="Edit" /&gt;
  </code></pre>
  
  <p>JQuery Setup:</p>
  
  <pre><code>$('#edit_button').click(function(){
      var code = editor.getCode(); // editor.getCode() is a codemirror function which gets the HTML from the text area
      var iframe = $('#render');
      iframe.html(code)
  })
  </code></pre>
  
  <p>This does not seem to load the HTML into the iframe, is there a special method to insert HTML into a iframe or is this not possible?</p>