JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<div class="top">
<span id="where_to_insert">
Anchor here
<a href="" id='somAnc'></a>
</span>
</div>
JavaScript
function load(Url, myImage) {
document.getElementById('somAnc').href = Url;
}
load('google.com');
setTimeout(function() { // Just for testing
load('mozilla.com')
}, 5000)