Changing the DOM by ID: getElementById<\/h1><\/strong> <\/strong> Introduction<\/h2><\/strong> In this assignment you will use JavaScript to read 3 item prices from the DOM. <\/strong> Calculate a subtotal, the sales tax amount and the total cost.<\/strong> Then you will update the DOM with the calculated values.<\/strong> <\/p><\/strong> In this assignment you will:<\/p><\/strong> <\/strong> - Demonstrate skills\/techniques learned from earlier assignments.<\/li><\/strong>
- Demonstrate the use of document.getElementById to read and change elements from the DOM.<\/li><\/strong>
- Demonstrate the use of textContents to read and change the text contents of an element in the DOM.<\/li><\/strong> <\/ul><\/strong> <\/section><\/strong>
<\/strong> Purchased Items<\/h2><\/strong> <\/strong> <\/strong> <\/strong> Item Name<\/th><\/strong> Quantity<\/th><\/strong> Item Price<\/th><\/strong> <\/th><\/strong> <\/tr><\/strong> <\/thead><\/strong> <\/strong> Backpack<\/td> 1<\/td> 56.99<\/td> <\/td><\/tr><\/strong> Calculator<\/td> 1<\/td> 104.89<\/td> <\/td><\/tr><\/strong> Textbook<\/td> 1<\/td> 51.97<\/td> <\/td><\/tr><\/strong> <\/tbody><\/strong> <\/strong> <\/td> <\/td> <\/td> Subtotal<\/td><\/tr><\/strong> <\/td> <\/td> <\/td> Tax<\/td><\/tr><\/strong> <\/td> <\/td> <\/td> Total Cost<\/td><\/tr><\/strong> <\/tfoot><\/strong> <\/table><\/strong> <\/section><\/strong> <\/main><\/strong> <\/strong>
Introduction<\/h2><\/strong> In this assignment you will use JavaScript to read 3 item prices from the DOM. <\/strong> Calculate a subtotal, the sales tax amount and the total cost.<\/strong> Then you will update the DOM with the calculated values.<\/strong> <\/p><\/strong> In this assignment you will:<\/p><\/strong> <\/strong> - Demonstrate skills\/techniques learned from earlier assignments.<\/li><\/strong>
- Demonstrate the use of document.getElementById to read and change elements from the DOM.<\/li><\/strong>
- Demonstrate the use of textContents to read and change the text contents of an element in the DOM.<\/li><\/strong> <\/ul><\/strong> <\/section><\/strong>
<\/strong> Purchased Items<\/h2><\/strong> <\/strong> <\/strong> <\/strong> Item Name<\/th><\/strong> Quantity<\/th><\/strong> Item Price<\/th><\/strong> <\/th><\/strong> <\/tr><\/strong> <\/thead><\/strong> <\/strong> Backpack<\/td> 1<\/td> 56.99<\/td> <\/td><\/tr><\/strong> Calculator<\/td> 1<\/td> 104.89<\/td> <\/td><\/tr><\/strong> Textbook<\/td> 1<\/td> 51.97<\/td> <\/td><\/tr><\/strong> <\/tbody><\/strong> <\/strong> <\/td> <\/td> <\/td> Subtotal<\/td><\/tr><\/strong> <\/td> <\/td> <\/td> Tax<\/td><\/tr><\/strong> <\/td> <\/td> <\/td> Total Cost<\/td><\/tr><\/strong> <\/tfoot><\/strong> <\/table><\/strong> <\/section><\/strong> <\/main><\/strong> <\/strong>
In this assignment you will:<\/p><\/strong> <\/strong>
Purchased Items<\/h2><\/strong>
<\/strong> <\/strong>
<\/strong> Item Name<\/th><\/strong> Quantity<\/th><\/strong> Item Price<\/th><\/strong> <\/th><\/strong> <\/tr><\/strong> <\/thead><\/strong> <\/strong> Backpack<\/td> 1<\/td> 56.99<\/td> <\/td><\/tr><\/strong> Calculator<\/td> 1<\/td> 104.89<\/td> <\/td><\/tr><\/strong> Textbook<\/td> 1<\/td> 51.97<\/td> <\/td><\/tr><\/strong> <\/tbody><\/strong> <\/strong> <\/td> <\/td> <\/td> Subtotal<\/td><\/tr><\/strong> <\/td> <\/td> <\/td> Tax<\/td><\/tr><\/strong> <\/td> <\/td> <\/td> Total Cost<\/td><\/tr><\/strong> <\/tfoot><\/strong> <\/table><\/strong> <\/section><\/strong> <\/main><\/strong> <\/strong>