Look at this:
var selection= $('table td:first-child');
In practice it selects the first row's <td>
elements in the table.
When I saw it for the first time, I took it as: Select all first-child elements within all <td>
in the <table> </table>
.
But what it does is: Select all <td>
within the table if it is the first-child of its parent. Means first <td>
between each tags.
So, the question is, does first-child selector works like a flag? Or it works like a kind of method to get the first-child of the element in question in the jQuery wrapper-set?
thanks,