Open the vw_election.html and vw_results.js files and enter your name and the date in the comment section of each file. Next, go to the vw_election.html file and directly above the closing tag, insert script elements to link the page to the vw_congminn.js and vw_results.js files in that order. Defer the loading and running of both script files until after the page has loaded. Scroll down the file and, directly above the footer, insert an empty section element. You will write the HTML code of the election report in this element. Open the vw_congminn.js file and study the contents. Note that the file contains the results of 8 congressional elections in Minnesota. The candidate information is stored in multidimensional arrays named candidate, party, and votes. Do not make any changes to this file. Calculate the totalVotes Next, go to the vw_results.js file and declare a variable named reportHTML containing the following HTML text: title where title is the value of the raceTitle variable stored in the vw_congminn.js file Create a for loop that loops through the contents of the race array using i as the counter variable. Place the commands specified in steps 1 through 5 within this program for loop: Create a variable named totalVotes that will store the total votes cast in each race. Set its initial value to 0. Calculate the total votes cast in the current race by applying the forEach() method to ith index of the votes array using the calcSum() function as the callback function. Add the following HTML text to the value of the reportHTML variable to write the name of the current race in the program loop:

Respuesta :

Otras preguntas