I may be sweating a
small point, or... maybe I don't see the forest for all the
trees...
I've been reading over
the docs and playing with primitive jQuery constructs.
The
docs...
the cheat
sheet
My question involves
whether the methods and properties operate on a jQuery object, the DOM or
something else.
I'm confused about
whether .addClass operates on a jQuery object as documented in jQuery.com/api/,
and is listed as "Traversing" in the cheat sheet. Seems to me .addClass
operates on the DOM, and is a "Manipulation" method?
If I can squeeze one
more question into this thread:
.eq(Number pos) and
.get(Number num) appear nearly the same. From
jquery.com/api/
.eq(): Reduce the set of matched elements to a single
element. The position of the element in the set of matched elements starts at 0
and goes to length - 1.
Example:
$("p").eq(1)
.get() Access a single matched element. num
is used to access the Nth element matched. (My
tests show that .get() uses zero relative 0...length-1, as does
.eq().)
Example:$("img").get(1);
The documents suggests .eq()
operates on a jQuery object, .get() operates on an Element, but the examples are
the same.
It looks like both
methods, .get and .eq, are identical, eq() provided for symmetry to match
.lt() and .gt(). Is this correct?
Sam
_______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
