JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="foo" />
JavaScript
setTimeout(function(){
document.getElementById("foo").focus();
}, 1000);
<input type="text" id="foo" />
setTimeout(function(){
document.getElementById("foo").focus();
}, 1000);