JSFiddle - React, Tailwind, and code Playground

HTML

<a href="http://google.com">Google</a>
<a href="http://stackoverflow.com">Stack Overflow</a>

JavaScript

var links = document.links;
    var lastLink = links[links.length - 1];
    var lastHref = lastLink.href;
    alert(lastHref);