Question: let table = document.getElementById ( ' myTable ' ) ; let subTotal = 0 ; for ( let row of table.rows ) { let priceCell
let table document.getElementByIdmyTable;
let subTotal ;
for let row of table.rows
let priceCell row.cells;
let quantityCell row.cells;
let price parseFloatpriceCelltextContent;
let quantity parseIntquantityCelltextContent;
let rowSubTotal price quantity;
priceCell.textContent rowSubTotal.toLocaleStringenUSstyle: 'currency', currency: 'USD';
priceCell.classList.addpricecolumn';
subTotal rowSubTotal;
let tax subTotal ;
let total subTotal tax;
let subTotalElement document.createElementp;
subtotalElement.textContent Subtotal: $subTotaltoLocaleStringenUS style: 'currency', currency: 'USD' ;
subtotalElement.classList.addsubtotal;
let taxElement document.createElementp;
taxElement.textContent Tax: $taxtoLocaleStringenUS style: 'currency', currency: 'USD' ;
taxElement.classList.addtax;
let totalElement document.createElementp;
totalElement.textContent Total: $totaltoLocaleStringenUS style: 'currency', currency: 'USD' ;
totalElement.classList.addtotal;
let tableFooter document.getElementByIdtableFooter;
tableFooter.appendChildsubtotalElement;
tableFooter.appendChildtaxElement;
tableFooter.appendChildtotalElement;
HOW DO I FIX THIS ERROR
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
