Answers for "php adding options from an array"

PHP
0

php adding options from an array

var example_array = {
    ValueA : 'Text A',
    ValueB : 'Text B',
    ValueC : 'Text C'
};

var select = document.getElementById("example-select");
for(index in example_array) {
    select.options[select.options.length] = new Option(example_array[index], index);
}
Posted by: Guest on October-18-2021

Code answers related to "php adding options from an array"

Browse Popular Code Answers by Language