Reputation: 3738
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:
<html>
<head>
</head>
<body>
<input id="outside-input" type="text"/>
<iframe>
<input id="inside-input" type="text"/>
</iframe>
</body>
</html>
I don't see how this would be rellevant but the iframe is in fact the Wordpress media upload pop-up.
Upvotes: 0
Views: 56
Reputation: 74410
If iframe is on same domain, you can access its content like this:
$('#outside-input').val($("iFrame").contents().find("#inside-input").val());
Upvotes: 2
Reputation: 15934
AFAIK you cannot access the content of the IFrame from your main page directly using JQuery / other JS.
Upvotes: 0