I have a div with the identifier "orangeButton", and every time you click on it, it creates a new div. This works fine, but ... I want every newly created div to have an extension added with an ID.
I am not sure how to do this.
Here is the script of the code that I have so far with comments.
http://jsfiddle.net/taoist/yPrab/1/
thanks
Javascript Code
var applicationArea = document.getElementById("applicationArea"); var orangeButton = document.getElementById("orangeButton"); orangeButton.onclick = function() { var newDivThingy = document.createElement("div"); newDivThingy.id = 'newDivThingy';
source share