Using Javascript, how can I change this classless anchor (assuming targeting unique href string):
<a href="/unique-url-string/"></a>
to this, on page load:
<a href="/replacement-url-string/"></a>
You can select the element based on its href prop.
$('a[href="/unique-url-string/"]').prop('href', '/replacement-url-string/');
If you want to only search the pathname of these urls and keep the domain name the same you can try something like:
$('a').filter(function() {
return this.pathname === "/foo/bar"
}).prop('href', function () {
this.pathname = '/butt/butt/butt';
return this;
});