Question: in the following code insert the code given to you below Hands-on Project 2-1 Hands-on Project 2-1 Fahrenheit ( F) to Celsius ( C) converter

in the following code insert the code given to you below

Hands-on Project 2-1

Hands-on Project 2-1

Fahrenheit (° F) to Celsius (° C) converter

Temp in ° C

1. At the bottom of the document, before the closing tag, enter to create a new script section.

2. Within the script section you created in the previous step, enter the following function.

function convert() {

var degF = document.getElementById("fValue").value;

var degC = degF - 32 * 5 / 9;

document.getElementById("cValue").innerHTML = degC;

}

3. Below the closing } for the convert() function, but before the closing tag, enter the following statement to add an event listener:

document.getElementById("button"). addEventListener("click", convert, false);

4. add two sets of parentheses to the first statement in the convert() function to modify the order in which the calculations are performed, as follows:

var degC = (degF - 32) * (5 / 9);

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!