JSFiddle - React, Tailwind, and code Playground
HTML
<form id="test">
<input type='text' />
</form>
JavaScript
window.onload = function(){
var inp = document.getElementsByTagName("input")[0];
inp.focus();
console.log("should be focused now");
};