<a href="somelink">Link</a>
a = document.getElementById(...); a.setAttribute("href", "somelink url");