JSFiddle - React, Tailwind, and code Playground
HTML
Credits Remaining: <input type="text" id="creditRemaining">
<br />
<div id="creditRemaining"></div>
<br />
<br />
<div id="total" style="color: red; text-align: right;"></div>
JavaScript
$(function() {
var output_element = $('#creditRemaining');
$('#creditRemaining').keyup(function() {
updateTotal();
});
var updateTotal = function () {
var input1 = parseInt($('#creditRemaining').val() || 0);
$('#total').text((input1 / 36).toFixed(2) + "% Prorated");
};
});