JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" placeholder="type:text">
<br><br>
<input type="number" placeholder="type:number">
<br><br>
<input type="tel" placeholder="type:tel">

JavaScript

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