Celsius into Fahrenheit

Updated: 07/06/2021 by Computer Hope
Mercury thermometer showing temperature of 40 degrees Celsius.

Example

Degrees Celsius     Degrees Fahrenheit

This JavaScript is designed to allow people visiting your web page to do their calculation/math assignment from your web page.

Source code

JavaScript

<script type="text/javascript">
 function temp (form) {
  form.fahrenheit.value = form.celsius.value*1.8+32;
 }
</script>

HTML code

<form>
<div align="center">
<p><input type="text" size="15" name="celsius"> <b>Degrees Celsius</b> <input type="button" value=" = " onclick="temp(this.form)"> <input Type="text" size="15" name="fahrenheit"> <b>Degrees Fahrenheit</b></p> </div> </form>