JSFiddle - React, Tailwind, and code Playground

HTML

<a href='https://facebook.com/'>Facebook</a>

<a href='https://google.ca/'>Google</a>

<input type='text' placeholder='an input box'>

JavaScript

function checkTabPress(e) {
    'use strict';
    var ele = document.activeElement;

    if (e.keyCode === 9 && ele.nodeName.toLowerCase() === 'a') {
        console.log(ele.href);
    }
}

document.body.addEventListener('keyup', function (e) {
    checkTabPress(e);
}, false);