JSFiddle - React, Tailwind, and code Playground
HTML
<a href="http://domain/t/test.com">test</a>
<a href="http://domain/f/foo.com">foo</a>
JavaScript
$("a").each(function(){
var pathname = $(this)[0].pathname;
$(this).attr("href", "http://www.google.com" + pathname);
});