how to bring the append values in dropdown

Issue

This Content is from Stack Overflow. Question asked by Ashwin Guna

function appendRow()
{
var x = document.getElementById('camnos').value;
var d = document.getElementById('myList');
alert('please enter the ip address');

for(var i=0; i < x; i++)
{
    var input = document.createElement('input'); 
    input.type = "text"; 
    input.id = "camera"+i;
     
    d.appendChild(input);
}
}
 //document.getElementById("btnSave").style.visibility = "hidden";
 function enterkey()
 
 {
var parent = document.getElementById('myList');
var childNodes = parent.childNodes;
for(var i = 0, len = childNodes.length;i<len;i++){
    if(childNodes[i].id === "camera0") {  
var number=document.getElementById("camera0").value;  
var x = document.getElementById("zonelist");
  var option = document.createElement("option");
  option.text = number;
  x.add(option);
  
}  
}
    
}

i want to add the append values in dropdown as options for php, pls help me with some other to . the requirement is to append the empty box, then values will be in the append empty box, the entered values has to be displayed in the dropdown as options



Solution

This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?