<select id="sel"> <option>1</option> <option>2</option> </select> <input type="button" value="add option" onclick=" var newLength = sel.options.length + 1; sel.innerHTML += ' <option>'+newLength+'</option>' ">