Select Two Children per Parent??

Select Two Children per Parent??

Hi,

Consider this:
<div class="eachcolumn">
<a href="#" class="mystyle">1</a>
<a href="#" class="mystyle">2</a>
<a href="#" class="mystyle">3</a>
<a href="#" class="mystyle">4</a>
<a href="#" class="mystyle">5</a>
</div>

<div class="eachcolumn">
<a href="#" class="mystyle">1</a>
<a href="#" class="mystyle">2</a>
<a href="#" class="mystyle">3</a>
<a href="#" class="mystyle greyit">4</a> <-- Selected
<a href="#" class="mystyle greyit">5</a> <-- Selected
</div>

<div class="eachcolumn">
<a href="#" class="mystyle">1</a>
<a href="#" class="mystyle">2</a>
<a href="#" class="mystyle greyit">3</a> <-- Selected
<a href="#" class="mystyle greyit">4</a> <-- Selected
<a href="#" class="mystyle greyit">5</a>
</div>

<div class="eachcolumn">
<a href="#" class="mystyle greyit">1</a> <-- Selected
<a href="#" class="mystyle greyit">2</a> <-- Selected
<a href="#" class="mystyle greyit">3</a>
<a href="#" class="mystyle greyit">4</a>
<a href="#" class="mystyle greyit">5</a>
</div>

How would I go about writing a JQuery selector to select two 'greyit' children per 'eachcolumn' as shown above and add CSS to it Eg: $('jquery selector code here').css("background", "red");
    • Topic Participants

    • ryan