JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" />
<input type="submit" />
JavaScript
$("input[type=submit]").click(function() {
var numberRegex = /\d/g;
var text = $("input[type=text]").val();
if (numberRegex.test(text)) {
alert("yes");
}
});