javascript get href of anchor tag code example Example: get href attribute javascript document.getElementById("link")[0].getAttribute("href");