I am trying to create a button that, when clicked on, returns how many times it has been pressed, as well as every time you click the button;
a new button is added to the page (this is a new button so that it has not yet been pressed). Each button added to the page should have the same interaction as the first button. Clicking on it increases its value and creates a new button on the page.
So far, I realized that the counter button is understandable, but it seems that it cannot add a button on the page. Please, help...
var clicks = 0; function onClick(){ clicks +=1; document.getElementById("button").innerHTML= "I've been clicked " +clicks + " times" ; };
source share