need help with this. i attached the image how it should look. 1 . Include the defer attribute to defer loading the file until the entire page is loaded. Study the contents of the HTML file, noting that all checkboxes for the menu items belong to the menuItems Save your changes to the file. 2. Go to the project03-01.js file in your code editor. Below the initial comment section, declare a variable named menuItems containing the collection of HTML elements belonging to the menuItem class using the getElementsByClassName() 3.Create a for loop that loops through the contents of the menuItems collection with a counter variable that starts with an initial value of 0 up to a value less than the length of the menuItems collection. Increase the counter by 1 with each iteration. Within the for loop, add an event listener to the menuItems[i] element in the collection (where i is the value of the counter), running the calcTotal() function when that item is clicked. 4. Create the calcTotal() function to calculate the total cost of the customer order given the selected menu items. Add the following commands to the function: Declare the orderTotal variable, setting its initial value to 0. Create a for loop that loops through the contents of the menuItems For menuItems[i] (where i is the counter), apply an if statement that tests whether the item has been checked. If true, increase the value of the orderTotal variable by the value of menuItems[i]. (Hint: Use the Number() function to convert the value of menuItems[i] to a number.) After the for loop, insert a command to change the innerHTML property of the element with the id "billTotal" to the value returned by the formatCurrency() function using orderTotal as the parameter value.
need help with this. i attached the image how it should look.
1 . Include the defer attribute to defer loading the file until the entire page is loaded. Study the contents of the HTML file, noting that all checkboxes for the menu items belong to the menuItems Save your changes to the file.
2. Go to the project03-01.js file in your code editor. Below the initial comment section, declare a variable named menuItems containing the collection of HTML elements belonging to the menuItem class using the getElementsByClassName()
3.Create a for loop that loops through the contents of the menuItems collection with a
counter variable that starts with an initial value of 0 up to a value less than the length of the menuItems collection. Increase the counter by 1 with each iteration. Within the for loop, add an event listener to the menuItems[i] element in the collection (where i is the value of the counter), running the calcTotal() function when that item is clicked.
4. Create the calcTotal() function to calculate the total cost of the customer order given the selected menu items. Add the following commands to the function:
Declare the orderTotal variable, setting its initial value to 0.
-
- Create a for loop that loops through the contents of the menuItems For menuItems[i] (where i is the counter), apply an if statement that tests whether the item has been checked. If true, increase the value of the orderTotal variable by the value of menuItems[i]. (Hint: Use the Number() function to convert the value of menuItems[i] to a number.)
- After the for loop, insert a command to change the innerHTML property of the element with the id "billTotal" to the value returned by the formatCurrency() function using orderTotal as the parameter value.
![Figure 3-18
Completed Project 3-1
Hands-on Project 3-1
Total Order Cost: $22.90
Lunch selections
Fried chicken ($11.95)
Fried halibut ($13.95)
Hamburger ($10.95)
Grilled salmon ($17.95)
Side salad ($8.95)](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fb754ef4b-3260-4a19-818e-008ba8e3a83c%2F4317ff09-eaf4-4c7d-b243-9bd94d9f092a%2Fbc9je1o_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 5 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)