Question
Add the missing lines in the Javascript code to complete the program in the given html file. That is add the two missing lines at
Add the missing lines in the Javascript code to complete the program in the given html file. That is add the two missing lines at the location highlighted in blue below:
Payment Due
Run the program and check it works fine
Attach the working .html file to Sakai
HTML SELECT: To create a drop down list we use the html tag
https://www.w3schools.com/tags/tag_select.asp
Definition and Usage:
The
The
Example:
As you can see highlighted above, we are adding the price of the items in the value field of the option. This can be then extracted as:
1- Extract the drop down component pizza: We can get the component using the document.getElementById as below:
var pizza = document.getElementById("pizza");
2- Extract the selected option in the drop down and fetch its value as:
var pizzaCost = parseInt(pizza.options[pizza.selectedIndex].value);
Cafe
Please place order below
Select Pizza
Select Coffee
Payment Due
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started