JSFiddle - React, Tailwind, and code Playground

by Teuta Koraqi

HTML

<input type="text" class="numbersOnly" value="" />

JavaScript

jQuery('.numbersOnly').keyup(function () { 
    this.value = this.value.replace(/[^0-9\.]/g,'');
});