Access iframe content

Hi there.
In my website I have iframe in which I put tinymce redactor. I’m trying to get content of that textarea, but I can’t get it.
It’s returning value that was before editing.

Here is my script.


<iframe src="ajax/load_tinymce.php" id="mce" height="500" width="100%"></iframe>

$value = $('#mce').contents().find(textareaidhere).html()

for example if in my textarea, I have default value written [text text text], and I’m editing that to [123 123 123], jquery returning me [text text text].

As I see the problem why I can’t get value, because there one more iframe. It’s like iframe inside iframe.

So using this I’m getting the content of the first iframe


$value = $('#mce').contents().find(textareaidhere).html()

But I need get value of the textarea from iframe which is by itself in this first iframe .

Hey, I got the solution.

To access multiple iframes, I used this


$('#mcs').contents().find('iframe').contents().find('body').html()

It’s working like this. I’m selecting content of first iframe which has id [ mcs ], than I’m searching for ifreame in this content, and at the end I’m selecting content of body from last iframe.

So this will get all body content from the second iframe.