I’m looking to take a website source and populate an array with a collection of links, filtered by their a class.
Say, for instance, the links were <a class="title">, how could I target each class and add the URL to an array?
Would Javascript or jQuery work better?
So, basically you create an array by using the Array constructor. Then you use JQuery’s each method to iterate over the links with class
title, getting their urls using the attr method and pushing them in the array along the way.