+ 1
If you have a tag that takes you to Google and you want to change it to Gmail then you can do following(applies in any case)
<a href="www.google.com">Google</a>
var link = document.getElementsByTagName('a')[0];
link.href = "gmail.com";
link.innerText = 'gmail';



