Question: 5.Given HTML that includes the element shipping cost goes here what will the following code do if the user enters 100 at the prompt? var

5.Given HTML that includes the element

shipping cost goes here

what will the following code do if the user enters 100 at the prompt?

var getInfo = function() {

var cost = parseFloat(prompt("How much does the item cost?"));

var ship = cost * .06;

document.getElementById("ship").innerHTML="Shipping: $" + ship.toFixed(2);

};

a.It will calculate the value of the ship variable, but the

element will remain unchanged

b.It will display "shipping cost goes here Shipping: $6.00" in the

element

c.It will display NaN in the

element because the starting text in this element is not a number

d.It will replace the text in the

element with "Shipping: $6.00"

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!