I am new to jQuery and I have a little problem understanding its array notation for objects. By reading jQuery docs and this article , it seems like you can refer to the nth element in the object returned by the selector, doing something like
$('.foo')[n];
Correctly? Should I use jQuery manipulation functions / effects in tandem? Something like (this does not work for me)
$('.foo')[0].hide();
I also tried, to no avail:
var arr = $('.foo').get(); arr[0].hide();
Is there something wrong with my syntax? What is the best way to do what I'm trying to do here?
Thanks!
jquery jquery-selectors
Jared roder
source share