Answers for "javascript array key value html select"

3

javascript array key value html select

var massiv = [ { "key": 0, "duration": 4, "price": 1000000 },{ "key": 1, "duration": 6, "price": 1250000 },{ "key": 2, "duration": 12, "price": 1500000 }, ];

var elementString = "<select>";
for (var i in massiv) {
  elementString += '<option value="'+massiv[i].duration+'">'+massiv[i].price+'</option>';
}    
elementString += "</select>";

console.log(elementString)
Posted by: Guest on October-13-2021

Code answers related to "javascript array key value html select"

Code answers related to "Javascript"

Browse Popular Code Answers by Language