I have an iframe that contains a textarea, like so:
<html>
<body>
<form id="form1">
<div>
<textarea id="area1" rows="15"></textarea>
</div>
</form>
</body>
</html>
I want to get the textarea text in the parent page. I've tried this:
var text = $('#frame1').contents().find('#area1').val();
But an empty string is returned. However, if I put a value within <textarea> tags this value is returned successfully:
<textarea id="area1" rows="15">something</textarea>
How can I get the value of the textarea from the page which contains the iframe?
var text = $('#frame1').contents().find('#area1').text();
, else. You need to debug and add watch and try all sorts of things... – Plastered