title: Trying to add an iframe using jQuery
body: <p>I'm trying to add an iframe using jquery this way below, but when I click the link it doesn't happen anything. </p>
  
  <p></p>
  
  <pre><code>&lt;head&gt;
  
      &lt;script type="text/javascript"
              src='//ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.js'&gt;&lt;/script&gt;
  
      &lt;script type="text/javascript"&gt;
  
          function fun(){
              $('&lt;iframe /&gt;');  // Create an iframe element
              $('&lt;iframe /&gt;', {
                  name: 'frame1',
                  id: 'frame1',
                  src: 'http://www.programmingfacts.com'
              }).appendTo('body');
  
      &lt;/script&gt;
  
      &lt;/head&gt;
  
      &lt;body&gt;
  
          &lt;a href="#" onclick="fun()"&gt;clica&lt;/a&gt;
  
      &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>