How To Convert From Celsius To Kelvin Using Javascript

admin_img Posted By Bajarangi soft , Posted On 21-11-2020

We can convert Temperature Celcius to Kelvin using javascript,So today we implement javascript to convert Celsius To Kelvin .

How To Convert From Celsius To Kelvin Using Javascript

Complete Code For Converting From Celsius To Kelvin Using Javascript.

<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>How To Convert From Celsius To Kelvin Using Javascript</title>
    <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet">
</head>
<style>
    body {
        background: darkgoldenrod;
    }
</style>
<body>
<body>
<div class="container">
    <br/><br/>
    <div class="text-center">
        <h1 id="color" style="color: white;">Convert From Celsius To Kelvin Using Javascript</h1>
    </div>

    <div class="well">
        <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>
    </div>
</div>
</body>
</html>

Related Post