JSFiddle - React, Tailwind, and code Playground

by Danish Enam

HTML

<input type="text" id='txtQty'>

JavaScript

$("#txtQty").keyup(function () {
    var txtQty = $(this).val().replace(/[^0-9\.]/g,'');
    $(this).val(txtQty);
	});