[jQuery] Re: newbie: test for null selection

2009-10-21 Thread BradW
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

[jQuery] newbie: test for null selection

2009-10-21 Thread BradW
How can I test that a control selection failed to find anything? This doesn't work: var sumthin = $('#IDoNotExist'); if (sumthin == null) alert('didnt find'); Thanks, Brad