JSFiddle - React, Tailwind, and code Playground
HTML
<a href="/demo">Demo Link</a>
JavaScript
(function(){
var a = document.getElementsByTagName('a')[0];
a.href = 'https://' + window.location.host + a.getAttribute('href');
})();