JSFiddle - React, Tailwind, and code Playground
HTML
<form onsubmit="return check()">
<label>Donne un chiffre</label>
<input type="tel" required="" pattern="[0-9]+" id="nombre"/>
<input type="submit"/>
</form>
JavaScript
function check()
{
if (isNaN($('#nombre').val()))
alert('Devrait pas arriver');
else
alert('Ok');
return false;
}