JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="quanText" maxlength="2" value="0"></input>
JavaScript
$("#quanText").keyup(function () {
$(this).val().replace(/[^\d\.]/g, '');
});
<input type="text" id="quanText" maxlength="2" value="0"></input>
$("#quanText").keyup(function () {
$(this).val().replace(/[^\d\.]/g, '');
});