Q:

jQuery selector $.each not looping through all divs

I have the following html
<div class="row-updated">
    <div>
        <span>Title</span>
        <span>Some text here</span>
    </div>
</div>

<div class="row">
    <div>
        <span>Title</span>
        <span>Some text here</span>
    </div>
</div>

<div class="row">
    <div>
        <span>Title</span>
        <span>Some text here</span>
    </div>
</div>

<div class="row-updated">
    <div>
        <span>Title</span>
        <span>Some text here</span>
    </div>
</div>

I want to update the text in the second span for each div with class 'row-updated'. 
var updated = $('.row-updated span:eq(1)');

$.each( updated, function( key, value ) {
    $(this).text('New text here');
});

But this does not seem to update all rows.  It updates the first but not the second. 

A:

You can achieve what you want like this:
var updated = $('.row-updated');

$.each( updated, function( key, value ) {
    $(this).find('span').eq(1).text('New text here');
});

A:

.eq() doesn't do what you think it does.  You need to use .nth-child() here. 
// nth-child() is 1-indexed as @ᾠῗᵲᄐᶌ  pointed out in the comment (thanks!). 
var updated = $('.row-updated span:nth-child(2)');

$.each( updated, function( key, value ) {
    $(this).text('New text here');
});

.eq will return the nth element out of the whole set of results, not the nth span.