CSS selector for grouped iterations

Posted by snaken on Stack Overflow See other posts from Stack Overflow or by snaken
Published on 2010-05-11T20:47:01Z Indexed on 2010/05/11 20:54 UTC
Read the original article Hit count: 421

Filed under:
|
|
|

Hi,

I have a number of elements that i want to loop through as groups. Consider this HTML:

<input class="matching match-1" />
<input class="matching match-1" />
<input class="matching match-2" />
<input class="matching match-2" />
<input class="matching match-2" />
<input class="matching match-3" />
<input class="matching match-3" />
// etc

I want a CSS selector that would allow me to loop through these as groups so there would be - using this example - 3 iterations of the loop (one for match-1, one for match-2 and one for match-3). The 1,2,3 etc is a variable used for grouping but this is not fixed so it cannot rely on hard coding of these values. Is this even possible? I'll be using jQuery or prototype not that that should matter really.

Thanks

© Stack Overflow or respective owner

Related posts about css-selectors

Related posts about css