That pretty much sums up the beauty of jQuery. :)
- Richard
On Thu, Oct 22, 2009 at 1:51 AM, BradW 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 i
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, wh
> How can I test that a control selection failed to find anything?
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
3 matches
Mail list logo