Javascript examples for DOM HTML Element:Select
Select box value on <select> and show the value in the textfield
<html> <head> <script type="text/javascript"> function assignText(obj) {/*w ww.j a va 2s.c o m*/ document.getElementById("textboxid").value = obj.options[obj.selectedIndex].value; } </script> </head> <body> <form action="#" method="post"> <select name="select" id="slectboxid" onchange="assignText(this)"> <option value="test">test</option> <option value="test2">test2</option> </select> <input type="text" name="text" id="textboxid"> </form> </body> </html>