Concept explainers
a)
To create a function named calcExp ()to calculate the total of the row and column from the travelExp tableand within this function, create a variable named expTable to reference all the element of the travelExp table in the dl_expenses.js file.
b)
To create a loop that execute for each row of the table to call the calcClass () function with the parameter named dateindex to set the value of the input element with the ID named subtotalindex . The index is the counter value of for loop. Format the value using the formatNumber () function to the 2 decimals in the dl_expenses.js file.
c)
To set the value of the input element named transTotal, lodgeTotal, mealTotal, and otherTotal by calling the function named calcClass()with the parameters named trans, lodge, meal, and other.Format the values using the formatNumber ()function to the 2 decimals in the dl_expenses.js file.
d)
To set the value of the input element named expTotal by calling the function named calcClass () with the parameters named sum and format the values using the formatUSCurrency ()function to style the currency to the USD in the dl_expenses.js file.
Want to see the full answer?
Check out a sample textbook solutionChapter 13 Solutions
EBK NEW PERSPECTIVES ON HTML5, CSS3, AN
- New Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage Learning