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