On May 6, 12:18 am, Karl Swedberg <k...@englishrules.com> wrote:
> On May 6, 2009, at 12:05 AM, kali wrote:
>
> > On May 5, 10:05 pm, mkmanning <michaell...@gmail.com> wrote:
> >> Accessing the elements by index returns the element itself. To call
> >> jQuery methods you'd need to do this:
> >> divs = $('div');
> >> div2 = divs[2];
>
> > THIS is what I did........
>
> > div2 = divs[2]  --> is IGNORED....
>
> It's NOT ignored. It returns a DOM node ( <div id="test3"> )

> Please re-read what mkmanning wrote, because he's absolutely correct.
>
>
>
> > pls runhttp://www.mayacove.com/dev/jquery/arrays.htmlon Firefox with
> > JS console open, you will see it says:
> > div2.addClass' is not a function... this is b/c the line div2 = divs
> > [2]  is IGNORED...
>
> No again. It's because you can't attach a jQuery method to a DOM node.

so this   divs = $('div');   is a query object but not this:

   div2 = divs[2];

i.e., var 'divs' is a query object (an array, supposedly, which all
jQuery wrappers return, right?)

but AN ELEMENT in that array (a jQuery object) is not a jQuery
object?

sorry, this IS a bit confusing....

Reply via email to