Say I do
var s = $(\'#something\');
and next I want to test if jQuery found #something, i.e. I want to test if s is empty.
s
Use the s.length property.
if(s.length == 0) { ... }
[edit] size() deprecated in jquery 1.8 http://api.jquery.com/size/