jquerydomiframejavascript-security

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


Solution

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