Write a JavaScript Program to achieve the following requirements from the provided webpage codes. An expected output has been provided for you. The user can select the type of pizza from the “Select a pizza” dropdown list. The user can enter the pizza quantity in the “Pizza Quantity” field. After the user clicks the “Add Pizza” button, the page will show the Pizza list and the quantity of each. Afterward, the selection of the “Select a pizza” dropdown list will go back to  “-----”  and the quantity in the  “Pizza Quantity”  field will go back to “0” After the user clicks the “Calculate Total Cost” button, the page will show the total cost of the order and start with the message “Total bill of the order is - ”. Add JavaScript event in the HTML file where necessary.       Pizzas Ordering Form    Simply select your pizza and enter quantity to calculate total order cost                      Select a pizza                                                                                                                          Pizza Quantity

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter1: Getting Started With Excel
Section: Chapter Questions
Problem 14RA
icon
Related questions
Question

Write a JavaScript Program to achieve the following requirements from the provided webpage codes. An expected output has been provided for you.

  1. The user can select the type of pizza from the “Select a pizza” dropdown list.
  2. The user can enter the pizza quantity in the “Pizza Quantity” field.
  3. After the user clicks the “Add Pizza” button, the page will show the Pizza list and the quantity of each. Afterward, the selection of the “Select a pizza” dropdown list will go back to  “-----”  and the quantity in the  “Pizza Quantity”  field will go back to “0
  4. After the user clicks the “Calculate Total Cost” button, the page will show the total cost of the order and start with the message “Total bill of the order is - ”.

Add JavaScript event in the HTML file where necessary.

<!DOCTYPE html>

<html>

  <body>

    <h1>Pizzas Ordering Form</h1>

   <p> Simply select your pizza and enter quantity to calculate total order cost </p>

   <form id="orderForm">
       <p>
           <label for="pizza_list">Select a pizza</label>
           <select name="pizza_list " id="pizza_list">
               <option value="---" selected id="empty">-----</option>
               <option value="10" name="Margherita">Margherita ($10 each)</option>
               <option value="12" name="Pepperoni">Pepperoni ($12 each)</option>           
               <option value="15" name="Supreme">Supreme ($15 each)</option>
           </select>
        </p>

       <p>
           <label for="pizza_quantity">Pizza Quantity</label>
           <input type="text" name="pizza_quantity" value="0" id="pizza_quantity">
        </p>

       <p> <input type="button" value="Add Pizza" id="add_pizza"> </p>    

        <p> <input type="button" value="Calculate Total Cost" id="total_cost"> </p>

    </form>

    <p><ul id="ulList"></ul></p>

    <div id="message"></div>

   <script>
         
// Your code goes here

    </script>

</body>

</html>

Pizzas Ordering Form
Simply select your pizza and enter quantity to calculate total order cost!
Select a pizza
Pizza Quantity 0
Add Pizza
Calculate Total Cost
Margherita ($10 each) : 2
Supreme ($15 each) : 3
Supreme ($15 each) : 1
●
Total bill of the order is - $80.00
Transcribed Image Text:Pizzas Ordering Form Simply select your pizza and enter quantity to calculate total order cost! Select a pizza Pizza Quantity 0 Add Pizza Calculate Total Cost Margherita ($10 each) : 2 Supreme ($15 each) : 3 Supreme ($15 each) : 1 ● Total bill of the order is - $80.00
<!DOCTYPE html>
<html>
<body>
<h1>Pizzas Ordering Form</h1>
<p> Simply select your pizza and enter quantity to calculate total order cost </p>
<form id="orderForm">
<p>
<label for="pizza_list">Select a pizza</label>
<select name="pizza_list
id="pizza_list">
<option value="---" selected id="empty">-----</option>
<option value="10" name="Margherita">Margherita ($10 each)</option>
<option value="12" name="Pepperoni" >Pepperoni ($12 each)</option>
<option value="15" name="Supreme">Supreme ($15 each) </option>
</select>
</p>
<p>
<label for="pizza_quantity">Pizza Quantity</label>
<input type="text" name="pizza_quantity" value="0" id="pizza_quantity">
</p>
<p> <input type="button" value="Add Pizza" id="add_pizza"> </p>
<p> <input type="button" value="Calculate Total Cost" id="total_cost"> </p>
</form>
<p><ul id="ulList"></ul></p>
<div id="message"></div>
<script>
// Your code goes here
</script>
</body>
</html>
Transcribed Image Text:<!DOCTYPE html> <html> <body> <h1>Pizzas Ordering Form</h1> <p> Simply select your pizza and enter quantity to calculate total order cost </p> <form id="orderForm"> <p> <label for="pizza_list">Select a pizza</label> <select name="pizza_list id="pizza_list"> <option value="---" selected id="empty">-----</option> <option value="10" name="Margherita">Margherita ($10 each)</option> <option value="12" name="Pepperoni" >Pepperoni ($12 each)</option> <option value="15" name="Supreme">Supreme ($15 each) </option> </select> </p> <p> <label for="pizza_quantity">Pizza Quantity</label> <input type="text" name="pizza_quantity" value="0" id="pizza_quantity"> </p> <p> <input type="button" value="Add Pizza" id="add_pizza"> </p> <p> <input type="button" value="Calculate Total Cost" id="total_cost"> </p> </form> <p><ul id="ulList"></ul></p> <div id="message"></div> <script> // Your code goes here </script> </body> </html>
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 10 images

Blurred answer
Knowledge Booster
Fundamentals of JavaScript
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L