Template:FahrenheitToCelsiusForm
Jump to navigation
Jump to search
<form>
Fahrenheit: <input type="text" name="fahrenheit" id="fahrenheit_input">
<input type="button" value="Convert" onclick="convertToFahrenheit()">
</form>
<script>
function convertToFahrenheit() { var fahrenheit = document.getElementById("fahrenheit_input").value; var celsius = (fahrenheit - 32) * 5/9; document.getElementById("celsius_result").innerHTML = "Celsius: " + celsius.toFixed(2); }
</script>