Create an array or object of elements with the same dynamic class
I currently the following jQuery collection / object:
[li.row-0, li.row-1, li.row-2, li-row-2, li.row-2, li.row-3]
Each class name is dynamically added to each element by a previous method.
The only consistent part of the class name is row-. The number can be
anywhere from 0 - ‡.
I want to create a new array or object of elements that are grouped by
same dynamic class name:
[li.row-0]
[li.row-1]
[li.row-2, li.row-2, li.row-2, li.row-2]
[li.row-3]
The above is just a guess of the outcome, as I am not 100% sure how best
to achieve this.
The aim is to be able to loop through .row-0, .row-1, .row-2, .row-3 and
do something with the elements in each individual row.
No comments:
Post a Comment