I want a new div to be created everytime I click on a button. And for that I've been using the following code:
function createDiv(){
var divTag = document.createElement("div");
divTag.id = "div1";
divTag.setAttribute("align","center");
divTag.style.border = "1px solid #ccc";
}
However this will give every created div the id "div1". I need all the div:s to have different id:s. It would be nice if every new created div would be named "div + increasing number" (div1, div2, div3, div4, div5) and so on.