JSFiddle - React, Tailwind, and code Playground
HTML
<script type="text/javascript">
$(function() {
$(window).bind('blur', function() {
$("input.focus:last").focus();
}).trigger('blur'); //run straight away
});
</script>
<input type="button" name="counter1" size="10" class="focus" value="button1">
<input type="button" name="counter2" size="10" class="focus" value="button2">