WDV221 Intro Javascript

Project-6 Arrays - Homework


Please complete the following exercises on this page. When complete post the page to your WDV221 folder on the server. Make a link in your WDV221 Intro Javascript page for this assignment. Contact your instructor and demonstrate that you have completed the assignment.

Using Blackboard complete the In Class Exercise Assignment. Download your Homework project and being working on it with your remaining time.

For each exercise use a comment line to put the Exercise number within the script. Also place a short description of what the script is doing.


Use the team and scores arrays from the In Class Exercises to begin with.

Create a function called updateScores( ). It will take the name and the score from the form below. It will look through the team array to find the requested team. When it finds the team it will add the Score value to the scores array that corresponds to the requested team. It will then display the new score from the array.

If the requested team is not in the array it will display a message next to the Team name texfield "Sorry, this team is not in your list of team names". HINT: Use the .innerHTML property of the span element located on the form.

Update Team Scores
Team Name:
Score:
New Total Score:

Hint: I would create a display function or use one from the In class exericses that will display the values of the team and scores arrays. Then you can see what is actually in your arrays as you work.

Extra Credit: If the team name is not in the array. The function will add the name to the team array and the score to the scores array. It will then display the new team and its score.