I'd appreciate if someone also points me to theory sources so i can grasp it better.
Suppose i have the following HTML:
eq is a strange jQuery selector, not really consistent with the CSS based logic of most selectors (emphasis mine in this documentation extract):
The index-related selectors (:eq(), :lt(), :gt(), :even, :odd) filter the set of elements that have matched the expressions that precede them
In short, the
eq(0) in the first case applies to the whole
$("anything :eq(0)") can return at most one element.
While in the second case, the
"li:eq(0)" selector is applied by
find to all matches of