On 19/01/07, Peter Bengtsson <[EMAIL PROTECTED]> wrote:
> Currently my code looks something like this:
>
> if ($('#warningmsg').size()) highlightWarningMsg();
>
> Is that the "correct" way of testing if a jQuery object contains anything?
>
>
> --
> Peter Bengtsson,
> work www.fry-it.com
> home www.peterbe.com
> hobby www.issuetrackerproduct.com

You could also do:

if ($('#warningmsg')[0])

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to