JSFiddle - React, Tailwind, and code Playground

by danhaswings

JavaScript

var searchForm = '<input id="header-search" type="text" class="form-control" placeholder="Search STRI...">';
$('body').append(searchForm);
$('#header-search').focus();

$('#header-search').on('blur', function() {
    alert('blur');
    if ($(this).val() == '' && $searchButton.is(':active') == false) {
        $(this).remove();
    }
});