**I have seen similar questions but they haven't provided me a close solution.
Add the new div <div class="container" id="section"style="border: 1px solid grey;"> and all the tables and fields hold with this div on a button click.
I'm trying to append it by following code.
function run() {
var div = document.createElement("div"); //create new div
div.addEventListener("click", run); //bind click to new div
this.appendChild(div); //append the new div to clicked div
this.removeEventListener("click", run); //remove the original click event
}
document.getElementById("section").addEventListener("click", run);
Can anyone please help me to sort this out. Thank you in advance.
document.getElementById("section")..removeEventListener("click", run);instead ofthis.removeEventListener("click", run); //remove the original click event