Assuming that the html contains the following structure:
text
Give the link an id text
And then access it in your script: document.getElementById('linkToChange').href='newAddress';
document.getElementById('linkToChange').href='newAddress';