Just started to learn HTML and encountered such a problem. I want to make a simple html page with <iframe> and <form> . In the form: a text box and a submit request button. The idea is to write something in the text field, click "send" and in the <iframe> see the page with the search results.

While I wrote this:

 <body> <iframe name="AAA" width="600" height="300"> </iframe> <form action="www.google.com" method="get" target="AAA"> <input type="text" name="text" size="20" value="что-то"> <input type="submit" value="Искать"> </form> </body> 
  • one
    on a clean html it does not work, a handler is needed - soledar10

1 answer 1

^^^^^ I would not be in a hurry to say so:

 <iframe src="" id="myframe" width="600" height="300"></iframe> <br /> <input id="mydata" /> <input type="submit" value="Send" onclick="document.getElementById('myframe').src ='http://www.bing.com/search?q='+getElementById('mydata').value;" /> 

Fiddle: http://jsfiddle.net/alpha9000/4qET6/

  • one
    Well, so it is not just HTML, there is still very much and JavaScript. - oleg_ismaylov