title: Replacing content within a div with an iframe
body: <p>I am trying to replace the content of a div with an iframe that allows the user to input a URL to display another page. I will, ideally, add another button next to the Change URL button that links to a specific page. </p>
  
  <p>However, I cannot get this code to work. I can get the div to be replaced with text and some html. But the iframe code won't load when I put this in. I am suspecting it's due to the quotation marks. </p>
  
  <p>I am a bit of a novice at javascript/JQuery so any help with this will be greatly appreciated.</p>
  
  <p>Here is what I have going for the code below. </p>
  
  <pre><code>        &lt;style&gt;
      #target {
          width: 200px;
          height: 340px;
      }
      &lt;/style&gt;
      &lt;script&gt;
      $(function load($){
          var $iframe = $('#target'),
              $change = $('#change'),
              $url = $('#url');
  
          $change.click(function url() {
              $iframe.attr('src', $url.val());
          });
      });
  
      document.getElementById("c_emot").innerHTML = "&lt;iframe id="target" src="/"&gt;&lt;/iframe&gt;&lt;br&gt;
  &lt;input id="url" type="text"&gt;&lt;br&gt;
  &lt;button id="change" type="button"&gt;Change URL&lt;/button&gt;";
      &lt;/script&gt;
  </code></pre>