var links = document.getElementsByClassName("NClass1"); for (var i = 0; i < links.length; i++) { console.log(links[i].href); };