Question
I keep having problems with my program. I type it in but it is not converting. My instructions are to create a Web page using
I keep having problems with my program. I type it in but it is not converting. My instructions are to create a Web page using JavaScript that converts celcius to farenheit and vice versa. It should reveal content when you hit go or enter or whatever. Also just got instructions that it has to look pretty with colors.
Temperature Converter
Celcius to Fahrenheit:
Fahrenheit to Celcius :
function cToF()
{
var celsius=document.getElementById("cel").value;
var cTemp = celsius;
var cToFahr = cTemp * 9 / 5 + 32;
var message = cTemp+'\xB0C is ' + cToFahr + ' \xB0F.';
document.getElementById("res").innerHTML = message;
}
function fToC()
{
var fahrenheit=document.getElementById("far").value;
var fTemp = fahrenheit;
var fToCel = (fTemp - 32) * 5 / 9;
var message = fTemp+'\xB0F is ' + fToCel + '\xB0C.';
document.getElementById("res").innerHTML = message;
}
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