Mega Code Archive

 
Categories / JavaScript DHTML / Data Type
 

Convert from Celsius to Fahrenheit

<html> <head> <title>A Simple Page</title> <script language="JavaScript"> function inputCels(){     var cels = 100;     ansFah = doFahCalc(cels);     alert(cels + " Degrees Celsius is " + ansFah + " Degrees Fahrenheit"); } function doFahCalc(cels){     var ans = ((1.8 * Number(cels)) + 32);     return (ans); } </script> </head> <body> <input type="button" value="Convert Celsius to Fahrenheit" onClick="inputCels();"> </body> </html>