Scripted Product List
Overview
In this assignment you'll use JavaScript to dynamically generate a product list from a JSON array.
Assignment
-
Create a new HTML page.
-
Add the necessary tags to your HTML page to display a header that says "Today's Menu". Then add an empty
div
tag to your page with an id of "menu". -
Create a new JavaScript file and link it to the page with a
<script>
tag. -
In the JavaScript file, add the necessary code to create an array of menu items for a restaurant and store that array in a variable.
-
Write the necessary JavaScript code to get a reference to the empty div tag you created in step 2.
-
Add the necessary JavaScript to loop through the array you created in step 4 and add a new paragraph item to the div for every item in the array. Give each paragraph a class of "menu-item".
-
Add the necessary CSS to style your menu and menu items.
-
Update the table of contents link on your index page if necessary.
-
Submit the url to your github pages site to MySVU. (This should be something like https://USERNAME.github.io/REPOSITORYNAME).
Hints
-
Step 6 is the only step containing things we've never done in an assignment before. Break the problem down into smaller pieces and figure out how to solve each piece.
-
Refer to the examples in Chapter 5 of your text, as well as hints on the W3 Schools site.