I would suggest simply not to use innerHTML on a
select
– it just
seems wrong.select
elements have easy to use methods to add new
options:`document.getElementById('day').options.add(new Option("1", "1"))`
the parameters in the above object creation are:
new Option("optionText", "optionValue")
Just wanted to add to this answer, because it might clarify to someone who get to this post.