Javascript examples for DOM:Element parentNode
Remove parent element with element.parentNode.remove()
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <table id="test"> <tbody> <tr> <td>one</td> <td>two</td> <td id="test" onclick="removerow(this);">remove</td> </tr> </tbody> </table> <script type="text/javascript"> function removerow(e) {//from w w w . j a v a 2 s .c o m e.parentNode.remove(); } </script> </body> </html>