Javascript examples for DOM HTML Element:Table
The tFoot property returns a reference to the <tfoot> element of a table.
A reference to the <tfoot> element of the table, or null if it is not defined
The following code shows how to Alert the innerHTML of <tfoot>:
<!DOCTYPE html> <html> <head> <style> table, td { border: 1px solid black; } </style>/*ww w . ja va 2 s . c o m*/ </head> <body> <table id="myTable"> <thead> <tr> <th>Month</th> <th>Savings</th> </tr> </thead> <tfoot> <tr> <td>Sum</td> <td>$1</td> </tr> </tfoot> <tbody> <tr> <td>January</td> <td>$1</td> </tr> <tr> <td>February</td> <td>$8</td> </tr> </tbody> </table><br> <button onclick="myFunction()">Test</button> <script> function myFunction() { console.log(document.getElementById("myTable").tFoot.innerHTML); } </script> </body> </html>