[jQuery] Method Clarification

[jQuery] Method Clarification

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT face=Arial><FONT
color=#0000ff><FONT size=2>I<SPAN class=041304312-07092006> may be sweating a
small point, or... maybe I don't see the forest for all the
trees...</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=041304312-07092006></SPAN></FONT></FONT></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN class=041304312-07092006>I've been reading over
the docs and playing with primitive jQuery constructs. 
</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=041304312-07092006></SPAN></FONT></FONT></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN class=041304312-07092006>The
docs...</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN class=041304312-07092006><A
href="http://jquery.com/api/">http://jquery.com/api/</A></SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN class=041304312-07092006>the cheat
sheet</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN class=041304312-07092006><A
href="http://www.define-web.com/jquery_cheat_sheet/jquery_cheat_sheet_080306_v1.pdf">http://www.define-web.com/jquery_cheat_sheet/jquery_cheat_sheet_080306_v1.pdf</A></SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=041304312-07092006></SPAN></FONT></FONT></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN class=041304312-07092006>My question involves
whether the methods and properties operate on a jQuery object, the DOM or
something else.</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=041304312-07092006></SPAN></FONT></FONT></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN class=041304312-07092006>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? 
</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=041304312-07092006></SPAN></FONT></FONT></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN class=041304312-07092006>If I can squeeze one
more question into this thread:</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=041304312-07092006></SPAN></FONT></FONT></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN class=041304312-07092006>.eq(Number pos) and
.get(Number num) appear nearly the same.  From
jquery.com/api/</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=041304312-07092006></SPAN></FONT></FONT></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT><FONT><SPAN
class=041304312-07092006>.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.</SPAN></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT><FONT face=Arial
color=#0000ff size=2><SPAN class=041304312-07092006>Example:
$("p").eq(1)</SPAN></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT><FONT face=Arial
color=#0000ff size=2><SPAN
class=041304312-07092006></SPAN></FONT></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT><FONT face=Arial
color=#0000ff size=2><SPAN class=041304312-07092006>.get() <FONT
face="Times New Roman" color=#000000 size=3>Access a single matched element. num
is used to access the Nth element matched. (<SPAN class=041304312-07092006><FONT
size=+0><FONT face=Arial color=#0000ff size=2><SPAN class=041304312-07092006>My
tests show that .get() uses zero relative 0...length-1, as does
.eq().)</SPAN></FONT></FONT></SPAN></FONT></SPAN></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT><FONT face=Arial
color=#0000ff size=2><SPAN
class=041304312-07092006>Example:$("img").get(1);</SPAN></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT><FONT face=Arial
color=#0000ff size=2><SPAN
class=041304312-07092006></SPAN></FONT></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT><FONT face=Arial
color=#0000ff size=2><SPAN class=041304312-07092006>The documents suggests .eq()
operates on a jQuery object, .get() operates on an Element, but the examples are
the same.</SPAN></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT><FONT face=Arial
color=#0000ff size=2><SPAN
class=041304312-07092006></SPAN></FONT></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT><FONT face=Arial
color=#0000ff size=2><SPAN class=041304312-07092006>It looks like both
methods, .get and .eq,  are identical, eq() provided for symmetry to match
.lt() and .gt().  Is this correct?</SPAN></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT><FONT face=Arial
color=#0000ff size=2><SPAN
class=041304312-07092006></SPAN></FONT></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT><FONT face=Arial
color=#0000ff size=2><SPAN
class=041304312-07092006></SPAN></FONT></FONT></SPAN><SPAN
class=041304312-07092006><FONT><FONT face=Arial color=#0000ff size=2><SPAN
class=041304312-07092006>Sam</SPAN></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT><FONT face=Arial
color=#0000ff size=2><SPAN
class=041304312-07092006></SPAN></FONT></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=041304312-07092006><FONT><FONT face=Arial
color=#0000ff size=2><SPAN
class=041304312-07092006></SPAN></FONT></FONT></SPAN> </DIV></BODY></HTML>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/