JSFiddle - React, Tailwind, and code Playground

HTML

<a href="http://google.com/"></a>

JavaScript

$('a').each(function(){
    var link = this.protocol + "//" + (this.hostname || this.pathname);
    alert(link);
});