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 element is used to create a drop-down list.

The

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);

Page Title

Cafe

Please place order below

Select Pizza

Select Coffee

Payment Due

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!