Question: 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

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

};

It will replace the text in the

element with Shipping: $6.00.

It will display NaN in the

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

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

element will remain unchanged.

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!