JSFiddle - React, Tailwind, and code Playground
HTML
<a href="http://www.google.se/search?q=123">123</a> <br>
<a href="http://www.google.se/search?q=456">456</a> <br>
<a href="http://www.google.se/search?q=789">789</a> <br>
JavaScript
var linkElement = "a";
var newURL = "http://search.yahoo.com/search?p=";
var newPlace = "Yahoo"
$(linkElement).each(function() {
var ID = $(this).text();
$('a').after("<span> <a href='" + newURL + "" + ID + "'>"+ newPlace + "</a></span>");
});