JSFiddle - React, Tailwind, and code Playground

by luka kupunia

HTML

<input type="text" pattern="[0-9]{3,4}" oninput="this.value = this.value.replace(/[^0-9]/g, '').replace(/(\..*)\./g, '$1');">