Template:FahrenheitToCelsiusForm: Difference between revisions

From Empire of Dragons
Jump to navigation Jump to search
(Created page with "<form> Fahrenheit: <input type="text" name="fahrenheit" id="fahrenheit_input"><br> <input type="button" value="Convert" onclick="convertToFahrenheit()"> </form> <div id="celsius_result"></div> <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); } <...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<form>
    Fahrenheit: <input type="text" name="fahrenheit" id="fahrenheit_input"><br>
    <input type="button" value="Convert" onclick="convertToFahrenheit()">
</form>


<div id="celsius_result"></div>
Blank for now.
 
<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>

Latest revision as of 12:25, 21 February 2024

Blank for now.