That pretty much sums up the beauty of jQuery. :) - Richard
On Thu, Oct 22, 2009 at 1:51 AM, BradW <brad...@gmail.com> wrote: > > Aha! So if I understand the implications of this, a selector always > returns a wrapper object that acts like BOTH a javascript array and > like a single DOM element – even though it is really neither. And > this allows us to write elegant code that treats selectors as single > objects, or as arrays, whether nothing or one thing or 17 things are > found. Is that right? > > On Oct 21, 7:35 pm, Dave Methvin <dave.meth...@gmail.com> wrote: > > if ( $("#missing").length == 0 ) > > // it's not there > > > > However, remember that if you apply jQuery methods to an empty > > selection it does nothing: > > > > $("#missing").hide(); // no-op >