JSFiddle - React, Tailwind, and code Playground

by Rob Crowther

HTML

<form>
    <label>URL
    <input id="theurl" type="url">
    </label>
    <label>Email
    <input id="theemail" type="email">
    </label>
    <button>Fake submit</button>
</form>

CSS

label { display: block; }

JavaScript

$('input').blur(function(event) {
    event.target.checkValidity();
}).bind('invalid', function(event) {
    setTimeout(function() { $(event.target).focus();}, 50);
});