How To Convert From Stones To Grams Using Javascript

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

We can Convert from Stones to Grams using formula Grams =Stones /0.00015747and we use this logical with javascript .So today we discuss how to convert from Stones to Grams using javascript

How To Convert From Stones To Grams Using Javascript

Complete Code For Converting From Stones To Grams Using Javascript.

<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>How To Convert From Stones To Grams Using Javascript</title>
    <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet">
</head>
<style>
    body {
        background: orange;
    }

    h1 {
        color: white;
    }
</style>
<body>
<body>
<div class="container">
    <br/><br/>
    <div class="text-center">
        <h1 id="color" style="color: black;">Convert From Stones To Grams Using Javascript</h1>
    </div>


    <div class="well">
        <p>
            <label>Stones</label>
            <input id="inputStones" type="number" placeholder="Stones" oninput="weightConverter(this.value)" onchange="weightConverter(this.value)">
        </p>
        <p>Grams: <span id="outputGrams"></span></p>

        <script>
            function weightConverter(valNum) {
                document.getElementById("outputGrams").innerHTML=valNum/0.00015747;
            }
        </script>
    </div>
</div>

</body>
</html>

Related Post