I'm working with a legacy jQuery project and need to get the indices of all columns of a table that have the class unsorted
. jQuery can easily get a single index, but I need to get an array of indices. How can I do this?
For example, this will return a single integer even though there are multiple columns with the unsorted
class:
$('.some-table th').index($('th.unsorted'))
Other Questions
Although this question mentions jQuery, it is really has nothing to do with jQuery or DOM elements, and therefore doesn't help me.