JSFiddle - React, Tailwind, and code Playground

by dmethvin

HTML

<input type=text />

JavaScript

// Does focus event fire on a focused element?

var inp = document.getElementsByTagName("input")[0],
    body = document.body;

inp.onfocus = function(e){
    body.appendChild(document.createTextNode("onfocus "));
};

setInterval(function(){ 
    inp.focus();
    body.appendChild(document.createTextNode("focused "));
}, 5000);