const createButton=()=>{
const button = document.createElement("button");
button.innerHTML = "make button";
const body = document.getElementsByTagName("body")[0];
body.appendChild(button);
button.addEventListener ("click", ()=> {
createButton();
});
}
createButton();
اجرای آنلاین : https://codepen.io/uchar/pen/JjGGZLq