get href attribute javascript

JavaScript
document.getElementById("link")[0].getAttribute("href");
Source

Also in JavaScript: