I have a program that creates a table every time I press a button.
The page keeps creating duplicate tables on click.
I am trying to delete/remove/replace the table if it exists but it doesn't do anything.
I have tried the following code
document.getElementById("paragraphDOM").outerHTML = "";
document.getElementById("paragraphDOM").remove();
document.getElementById("paragraphDOM").removeChild(tbl);
document.getElementById("paragraphDOM").blur;
document.getElementById("paragraphDOM").innerHTML = "";
None of these gets rid of the original table, I even tried creating a paragraph and adding the table to it and then removing it as I got an error trying to set outer html to "" that it needed a parent.