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