Course Solutions Uncategorized (Solved) : 5given Html Includes Element Shipping Cost Goes Following Code User Enters 100 Prompt Var Q27275518 . . . .

(Solved) : 5given Html Includes Element Shipping Cost Goes Following Code User Enters 100 Prompt Var Q27275518 . . . .

 

5.Given HTML that includes the element

<p id = “ship”>shipping cost goes here</p>

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

var getInfo = function() {

var cost = parseFloat(prompt(“How much does the itemcost?”));

var ship = cost * .06;

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

};

a.It will calculate the value of the ship variable, but the<p> element will remain unchanged

b.It will display “shipping cost goes here Shipping: $6.00” inthe <p> element

c.It will display NaN in the <p> element because thestarting text in this element is not a number

d.It will replace the text in the <p> element with”Shipping: $6.00″

Expert Answer


An answer will

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post