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,'');
});
by Teuta Koraqi
<input type="text" class="numbersOnly" value="" />
jQuery('.numbersOnly').keyup(function () {
this.value = this.value.replace(/[^0-9\.]/g,'');
});