Javascript examples for DOM:Element remove
Remove element from document
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//w w w . j a v a 2s .co m var btn = document.getElementById('btn'); btn.onclick = function () { document.getElementById('txt').remove(); this.remove(); }; } </script> </head> <body> <p id="txt">Can i put it here?</p> <input id="btn" type="submit" value="REMOVE THAT!!!"> </body> </html>