It's not clear from the small example whether there's a pattern to the -one
and -two
class names.
If there is a pattern, and your idea is to have alternating classes (eg odd and even rows?), then you might want to consider using the nth-child()
selector. This will allow you to select the relevant elements without needing to reference any class names at all.
In this case, you could do something like this:
<div class='container'>
<span class="test"></span>
<span class="test"></span>
<span class="aaa"></span>
<span class="test"></span>
</div>
and then the jquery:
$('container span:nth-child(odd)')
and
$('container span:nth-child(even)')
See the jQuery manual for nth-child
for more info.
If this isn't what you're looking for, then I would suggest following @NielsKeurentjes advice and using multiple class names in the relevant elements.
Hope that helps.