title: Get data from iframe
body: <p>I am doing this first time. I have created an <code>iframe</code> on my page and I want the text from the <code>iframe</code> through <code>jquery</code>.
  Here is my code :</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;&lt;script src="http://code.jquery.com/jquery-1.9.1.min.js"&gt;&lt;/script&gt;
  
      &lt;script type="text/javascript"&gt;
      function copyIframeContent(iframe){  
          var iframeContent = $(iframe).contents(); //alert(iframeContent);
          //$("#result").text("Hello World");
          $("#result").html(iframeContent.find('body').html);alert(iframeContent.find('body').html());
      }
      &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;iframe id="myIframe" onload="copyIframeContent(this);" name="myIframe" src="text.php"&gt;&lt;/iframe&gt;&lt;br /&gt;
      Result:&lt;br /&gt;
      &lt;textarea id='result'&gt;&lt;/textarea&gt;
      &lt;input type="button" value="click" id="btn" onclick="aa()"&gt;
      &lt;script type="text/javascript"&gt;
           function aa(){  alert("Fdf");
              alert(document.getElementById('myIframe').contentWindow.document.body.innerHTML);
      }
      &lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>text.php:</p>
  
  <pre><code>text to change
  </code></pre>
  
  <p>I tried a lot in all browsers but still this is not working.
  Can anyone help me to get this content?</p>