To add an option to a dropdown select box with JavaScript, first create the option that will be added. Then add the option, as shown in the following example.
If this is the select list:
<select name='dropdown' id='dropdown'>
<option value='1'>1</option>
<option value='2'>2</option>
</select>
This JavaScript will add an option at the end of the list with a value of 3 and a label of 3:
var objDropdown = document.getElementById('dropdown');
var objOption = new Option('3','3');
document.write(objOption.value);
objDropdown.options[objDropdown.length] = objOption;
The two arguments to the Option method are text and value. Text is what shows in the dropdown box and is the first argument. Value is what is sent with the form submission and is the second argument. Note also that the length of the dropdown box is used to put the new option at the end of the list. A value could be hard-coded here, if desired.
Related articles:
How to Remove All Options from a Dropdown Select Box with JavaScript
How to Remove an Option from a Dropdown Select Box with JavaScript