I'm not quite sure that this is what you are looking for by anchoring id
<a href="#" id="mylink">link</a>
then just update the attribute hrefto change the new location (perhaps when changing at the input?
<input onchange="changeLink(this)" value="http://www.google.com/"/>
function changeLink(elem) {
var mylink = document.getElementById('mylink');
mylink.href = this.value;
}
Each time the value in inputchanges, the href value will be changed in accordance with
source
share