Linked Questions

Popular Questions

i've created 5 divs with looping.I want to put value into 1 of the divs.The codes i created is not working well.this is my code

var container = document.getElementById("container");
for (var i = 0; i < 5; i++) {
    container.innerHTML += '<div class="result'+i+'"></div>';
}

var colors=['red','blue','green'];
document.getElementById("result1").innerHTML="var colors=['red','blue','green']; " + colors;

Related Questions