JSFiddle - React, Tailwind, and code Playground

by captain_theo

HTML

<h3>
    Hz to Bpm
</h3>
<div>
    <label>Hertz</label>
    <input type="text" id="user_input_hertz" />
</div>
<div>
    <label>Bpm</label>
    <input type="text" id="result_bpm" readonly />
</div>
<hr />
<h3>
    Inches to Centimeters
</h3>
<div>
    <label>Inches</label>
    <input type="text" id="user_input" />
</div>
<div>
    <label>Centimeters</label>
    <input type="text" id="result" readonly />
</div>

JavaScript

$(document).ready(function(){
    $('#user_input_hertz').on('propertychange input keyup', function(){
        var thisVal = $(this).val();
        $('#result_bpm').val(thisVal * 60);
    });
    $('#user_input').on('propertychange input keyup', function(){
        var thisVal = $(this).val();
        $('#result').val(thisVal * 2.54);
    });
});