运行 ❯
获取您
自己
的网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <title>Fahrenheit to Celcius Temperature Converter</title> <body> <h2>Temperature Converter</h2> <p>Type a value in the Fahrenheit field to convert the value to Celsius:</p> <p> <label>Fahrenheit</label> <input id="inputFahrenheit" type="number" placeholder="Fahrenheit" oninput="temperatureConverter(this.value)" onchange="temperatureConverter(this.value)"> </p> <p>Celcius: <span id="outputCelcius"></span></p> <script> function temperatureConverter(valNum) { valNum = parseFloat(valNum); document.getElementById("outputCelcius").innerHTML=(valNum-32)/1.8; } </script> </body> </html>