Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 575
Ivošš Avatar asked May 02 '26 11:05

Ivošš


1 Answers

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

like image 181
Stefan Kanev Avatar answered May 04 '26 02:05

Stefan Kanev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!