Ivan ZugecContactContact me
All posts

Dynamically change select options with JavaScript

If you ever need to change a select box via javascript use the code below.

document.myFormName.mySelectName.options[2] = new Option("label", "value", true);

For more information go herehttp://www.javascriptkit.com/javatutors/selectcontent.shtml and http://www.javascriptkit.com/jsref/select.shtml#section2.

Hiring, or have a project in mind?

Get in touch and tell me about the role or what you're building.

Contact me