Fixed JS error while selecting the table tfoot element