JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="txtSearch" />
<input type="text" id="txtSearch2" />
JavaScript
$(function(){
$("html").click(function(){
$("#txtSearch").focus();
});
});
<input type="text" id="txtSearch" />
<input type="text" id="txtSearch2" />
$(function(){
$("html").click(function(){
$("#txtSearch").focus();
});
});