Just to throw in my 2cents/pence worth...

In the early versions of jQuery we could use $('#id').is() to return
true if the array contains any values. This stopped working in more
recent versions. If you like that solution it could be resurrected by
enhancing the is() method in your code using something like this
(untested):

(function($) {

        var _is= $.is;        // Retain a reference to jQuery's
original is() method before we "overload" it.

        $.fn.is = function(expr) {
                return expr ? _is.apply(this,arguments) : !!
this.length;        // Return .length instead when is() is called
without a parameter.
        };

})(jQuery);


Happy New Year!
George



On Dec 28, 1:23 am, McLars <[EMAIL PROTECTED]> wrote:
> I say, the code would look better semantically:
>
>   if($('#id').exists())
>
> Until then, I think .is() is clearer than .length. To each their own. Both 
> work, and choice is a good thing.

Reply via email to