I am trying to use the following for loop but still showing one option.
var x = document.getElementById("cars");
var option = document.createElement("option");
for(var i=0;i<5;i++)
{
option.text = "BMW";
x.add(option);
}
I am trying to use the following for loop but still showing one option.
var x = document.getElementById("cars");
var option = document.createElement("option");
for(var i=0;i<5;i++)
{
option.text = "BMW";
x.add(option);
}