Restaurant Objects / Dom Review
Today you're making a restaurant, to start this restaurant your first going to make a menu.
- Make an array of three object literal dishes for your menu.
- Make a constructor function for a dish object
- Add 3 more items to your menu using the constructor function.
Now we are going to need to make a website to keep this menu on. Go and design a basic menu site with dummy items for your menu. Only use HTML/CSS no JavaScript yet.
After we have our basic site lets output our data on
the page using JavaScript.
- Make a for loop to iterate over the menu array.
- Inside of the loop use document.createElement to make a new LI tag
- Next use document.createTextNode to make a new textNode with for menu item
- Append your text element to your LI element
- Append your LI element to the DOM
If you get stuck you can find an example here: https://gist.github.com/JacobTheEvans/a6ac94bc38f5b0fc848c5d920447651f