title: Adding iframe and paragraph elements dynamically
body: <p>I want to add iframe element to the page and then add <code>&lt;p&gt;</code> element inside that iframe.<br>
  I tried this:</p>
  
  <pre><code>var iframe = document.createElement('iframe');
  iframe.frameBorder = 1;
  iframe.width = "500px";
  iframe.height = "250px";
  iframe.id = "iframe";
  
  var p = document.createElement('p');
  iframe.appendChild(p);
  document.getElementById("div").appendChild(iframe); //this is a div  that I have in body.
  </code></pre>
  
  <p>The iframe is added to the page but P is not added into iframe(iframe's body)      </p>