3

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

Joshua
  • 40,822
  • 8
  • 72
  • 132
Ivošš
  • 1,106
  • 12
  • 18
  • Maybe http://stackoverflow.com/questions/364952/jquery-javascript-accessing-contents-of-an-iframe?rq=1 ? An iframe contains some secruity limits, so you can't handle it like a normal page – Reporter Apr 30 '15 at 09:10

1 Answers1

1

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

Stefan Kanev
  • 311
  • 4
  • 7