Using javascript, (no jQuery libraries)
What i'd like to do is when I type a value into the inputbox and I hit my enter key (in the textbox only) i'd like to have the value of the inputbox be added into the drop down box.
Note that if there is an existing value in the already in the drop down box, the next value should just be added below the existing value.
How do I set this up?
Here is the html setup:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<input type="text" id="theinput" style="width: 100px;">
<select id="thebox" style="width: 100px;"></select>
</body>
</html>
See Question&Answers more detail:os