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