title: Get textarea text with JavaScript or jQuery
body: <p>I have an iframe that contains a textarea, like so:</p>
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  
  &lt;form id=&quot;form1&quot;&gt;
  &lt;div&gt;
      &lt;textarea id=&quot;area1&quot; rows=&quot;15&quot;&gt;&lt;/textarea&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>I want to get the textarea text in the parent page. I've tried this:</p>
  <pre><code>var text = $('#frame1').contents().find('#area1').val();
  </code></pre>
  <p>But an empty string is returned. However, if I put a value within &lt;textarea&gt; tags this value is returned successfully:</p>
  <pre><code>&lt;textarea id=&quot;area1&quot; rows=&quot;15&quot;&gt;something&lt;/textarea&gt;
  </code></pre>
  <p>How can I get the value of the textarea from the page which contains the iframe?</p>