DOM Forms Review Practice
Steps
-
Use
starter.html
as a starting point. Add an HTML Form that resembles the screenshot. -
Add a script that waits for the DOM and handles the form submission.
- When the form is submitted create an object with the information that the user entered. This object represents a pizza order and looks like this. Your object should use the same key names:
let order = { first_name: "Jhon", last_name: "Snow", address: "1234 Main St, 2nd Fl, Hometown", size: "small", crust: "thick", topping: [ "1", "2", "4", "8" ], special_instructions: "No Cheese" }
- Enqueue the
order
object into aQueue
instance. Use theQueue
class definition seen in here
-
Add JavaScript that handles the
Dequeue
button. -
Note the script in the head
<script src="enableDOMQueue.js" ></script>
has a function that will enable your Queue to display in the DOM. You must call the functionenableDOMQueue(yourQueue)
in the last line inside your event listener for"DOMContentLoaded"
-
Note Toppings values are like so:
1 = Anchovies
2 = Ham
3 = Pepperoni
4 = Sausage
5 = Broccoli
6 = Green Olives
7 = Mushrooms
8 = Roasted Garlic