I'm trying to create a loop that will retrieve the href values from certain elements and store them in an array. Can someone help me with this?
var linksArray = [];
var elements = document.getElementsByClassName("title");
for (var i = 0; i < elements.length; i++) {
linksArray.push(elements[i].href);
}
Appreciate any assistance. Thanks!