Javascript examples for DOM HTML Element:TableData
Delete the entire table using Javascript
<html> <head> <script type="text/javascript"> function removeTable(id) {/*from w w w . j a va 2 s .c om*/ var tbl = document.getElementById(id); if(tbl) tbl.parentNode.removeChild(tbl); } </script> </head> <body> <table id="toc" class="toc" border="1" summary="Contents"> <tbody> <tr> <td>This table is going</td> </tr> </tbody> </table> <input type="button" onclick="removeTable('toc');" value="Remove!"> </body> </html>