Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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)
Comment

PREVIOUS NEXT
Code Example
Javascript :: hue api unauthorized user 
Javascript :: json schmea typs 
Javascript :: 16/27.5 
Javascript :: useMutation on success function not being called 
Javascript :: matomo error tracking 
Javascript :: how to sort array alphabetically in javascript 
Javascript :: invoke lambda nodejs 
Javascript :: var socket = io(); reconnect 
Javascript :: Do not know how to serialize a BigInt 
Javascript :: jquery cdn google 
Javascript :: jquery get select option attribute 
Javascript :: vue call method after delay 
Javascript :: mongo create user 
Javascript :: js map over object 
Javascript :: javascript size of variable in kb 
Javascript :: double matrix iteration in react 
Javascript :: how to do regex email validation with domain 
Javascript :: javascript remove empty elements from array 
Javascript :: how to add event listener to iframe 
Javascript :: javascript change data attribute value 
Javascript :: valid json return null on json_decode 
Javascript :: nodemon compile typescript and execute js file 
Javascript :: scrool to top jquerry 
Javascript :: javascript lerp 
Javascript :: how to make apk react native 
Javascript :: regex to check if string contains special characters javascript 
Javascript :: using .indexOf() in jShell 
Javascript :: remove item from localstorage 
Javascript :: js push params to url 
Javascript :: stringify 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =