How do I make a new div with a specific Id + n?
- by Noor
I've got a button and when it's pushed this code launches:
var nrDivs = "1"
var neuDiv = document.createElement("div");
neuDiv.setAttribute("Id","theDiv" + nrDivs);
neuDiv.innerHTML = "Text";
$('#allDivs').append(neuDiv);
newfeed.draw(neuDiv);
I know that right now the script creates a new div with the ID: theDiv1.
What I'm trying to do is when I click the button a second time, it creates a div with the ID: theDiv2.
Each time the user presses the button there should be a new div drawn and I'm trying to target that new div and insert dynamic text.
Thanks, Noor