JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id=a />
<input type="text" id=b />
<input type="text" id=c

JavaScript

var lastClick = null;
$('input').mousedown(function(e) {
  lastClick = e.target;
}).focus(function(e){
    if (e.target == lastClick) {
      console.log('click');
    } else {
      console.log('tab');    
    }
    lastClick = null;

});