JSFiddle - React, Tailwind, and code Playground

HTML

<div class='row'>
    <input type='text' />
    <input type='text' />
    <br>
    <input type='text' class='link' value='the link' />
</div>

CSS

.linksdiv {
    background: yellow;
}

.link {
    color: blue;
    border: 0;
    outline: 0;
    text-decoration: underline;
    background: transparent;
    cursor: pointer;
}

JavaScript

var lastInput;

$('input').focus(function() {
    var $th = $(this);
    if( $th.is(':not(.link)') ) {
        lastInput = $th;
        $th.parents('.row').addClass("linksdiv");
    }
}).blur(function() {
    $(this).parents('.row').removeClass("linksdiv");
});

$('.link').keydown(function() {
    return false;
})
    .click(function() {
        $(this).blur();
        lastInput.focus();
        // run your code
    });