i have a function that creates div's according to a number indicated in a textbox. What I want is to have the created div, go inside another div (which is a popup, not visible from load (its a calculator by the way)).
So Far I have this:
Code: Select all
newDiv = document.createElement("div");
newDiv.innerHTML = "<input type='text'>";
my_div = document.getElementById("main");
document.body.insertBefore(newDiv, my_div);Also, how could I call the div a different name according to the current status of the loop, I realise it could be done quite easily if it was a straight number, but I would like it a bit more obvious than that, eg. Div1.
eg.
Code: Select all
Loop 1:
newDiv1
Loop2:
newDiv2