Loop through selected elements with jQuery
There may be times when you need to loop through elements in jQuery to collect information, change state or some other nifty trick that can’t be done easily using jQuery’s various selection etc functions. This post has an example of looping through elements with jQuery by getting all the href attributes from the <a> tags of a selected element.