Take the 2-minute tour ×

So i have this problem: I have an input in an iframe with some text in it and another input outside the iframe,in the page body which is empty. What I need is to copy the text in the iframe input to the other input. How can I do this?

Example code:

    <input id="outside-input" type="text"/>
      <input id="inside-input" type="text"/>

I don't see how this would be rellevant but the iframe is in fact the Wordpress media upload pop-up.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

If iframe is on same domain, you can access its content like this:

share|improve this answer
I would assume if it was on the same domain there would be an easier way of getting the information than loading it via an IFrame but as he hasn't mentioned either way this suits. –  webnoob Dec 6 '12 at 11:21
@webnoob Sometimes plugins dont let you the choice, see all the Wysiwyg editors that generally use iframe, and here, seems the case for this wp plugin –  A. Wolff Dec 6 '12 at 11:23
(why can't I add @roasted) - Good point. I didn't notice the comment about WP at the bottom. –  webnoob Dec 6 '12 at 11:25
add comment

AFAIK you cannot access the content of the IFrame from your main page directly using JQuery / other JS.

share|improve this answer
any other way? I'm opened to any sugestions –  sticksu Dec 6 '12 at 11:11
If the IFrame content is from an eternal source, no. Do you "need" to use an IFrame? –  webnoob Dec 6 '12 at 11:24
add comment

Your Answer


