JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" value="one" /><br/>
<input type="text" value="two" /><br/>
<input type="text" value="three" /><br/>
<p>Previous focus:</p>
<div id="prev"></div>
JavaScript
(function() {
var prevFocus;
$("input").focus(function() {
if (typeof prevFocus !== "undefined") {
$("#prev").html(prevFocus.val());
}
prevFocus = $(this);
});
})();