How can I select my newly added value in the select box (dropdown) after the value that was inputted into the textbox and the add button was clicked?\[code\]<html> <head> <script> function addref(value) { var x = document.getElementById("thebox"); var option = document.createElement("option"); option.text = value x.add(option,x.options[null]) } </script> </head> <body> <form> <select id="thebox"> </select> </form> <br> <input type="text" id="theinput"/> <input type="button" value="http://stackoverflow.com/questions/14526763/Add" name="B1" onclick="addref(document.getElementById('theinput').value)"/> </body></html>\[/code\]