Tryit Editor v1.4

<html> <head> <script type="text/javascript"> function favBrowser() { var mylist=document.getElementById("myList"); document.getElementById("favorite").value=mylist.options[mylist.selectedIndex].text; } </script> </head> <body> <form> Select your favorite browser: <select id="myList" onchange="favBrowser()"> <option>Internet Explorer</option> <option>Netscape</option> <option>Opera</option> </select> <p>Your favorite browser is: <input type="text" id="favorite" size="20"></p> </form> </body> </html> | Your Result:
Edit the code above and click to see the result. | W3Schools.com - Try it yourself