H. the experts needed to fill the select list from the array.

There is an array like this:

ion.sound({ sounds: [ {name: "join"}, {name: "join1"}, {name: "join2"}, {name: "join3"}, {name: "join4"}, {name: "join5"} ], }); 

How now to create a drop-down select list filled with an option from this array?

    1 answer 1

    If I understood correctly, after connecting the jQuery library we do:

     <script> var sounds = [ {name: "join"}, {name: "join1"}, {name: "join2"}, {name: "join3"}, {name: "join4"}, {name: "join5"} ]; ion.sound({ sounds: sounds }); var html = '<select>'; for(var i in sounds) { html += '<option value="' + sounds[i].name + '">' + sounds[i].name + '</option>'; } html += '</select>'; $('#result').html(html); </script> <div id="result"></div>