JSFiddle - React, Tailwind, and code Playground HTML <form> <input type="text" pattern="\d+" /> <input type="submit" /> </form>