JSFiddle - React, Tailwind, and code Playground
by Sumit Patel
HTML
<form>
<input class="Amount" type="Amount" />
</form>
JavaScript
$(document).on('keyup', '.Amount', function() {
var x = $(this).val();
$(this).val(x.toString().replace(/,/g, "").replace(/\B(?=(\d{3})+(?!\d))/g, ","));
});