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.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

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.

    1. 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.)
    2. 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)
Transcribed Image Text: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)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 5 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY