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