how to get href link in html code example Example: get href attribute javascript document.getElementById("link")[0].getAttribute("href");