js on destroy code example Example: element destroy js var myobj = document.getElementById("demo"); myobj.remove();