<html> <head> <script type="text/javascript"> function put() { txt=document.forms[0].myList.options[document.forms[0].myList.selectedIndex].text document.forms[0].favorite.value=txt } </script> </head> <body> <form> Select your favorite browser: <select name="myList" onchange="put()"> <option>Internet Explorer</option> <option>Netscape</option> <option>Opera</option> </select> <br /><br /> Your favorite browser is: <input type="text" name="favorite" size="20"> </form> </body> </html>
Edit the text above, and click on the button to see the result.
Copyright © 2007-2008, Www.JavaBasics.We.Bs All rights reserved.