Ivošš
Ivošš

Reputation: 1156

How to insert value to external iframe input

I have button and external iframe, and I need click to button to insert to this iframe input some value

$("#button").click(function(){
    $('iframe').find('input').val('value');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<button id='button'>test</button>
<br>
<iframe src="http://www.abc.sk/pridat.aspx" width='900' height='500'></iframe>

EXAMPLE

Upvotes: 3

Views: 655

Answers (1)

Stefan Kanev
Stefan Kanev

Reputation: 311

Main frame and pridat.aspx have to be hosted on the same domain www.abc.sk

Upvotes: 1

Related Questions