[jQuery] Re: searching css id

2008-04-22 Thread Hamish Campbell
Because this wasn't immediately obvious to me when I started out, here is why: The jQuery selector will always return an object. Eg: typeof($("#doesntExist")) == "object". That means if( $("#doesntExist") ) will evaluate true. This is intentional - ie, if you do something like this: $

[jQuery] Re: searching css id

2008-04-22 Thread Josh Nathanson
Try doing if ( $('#specialSection').length ) in your conditional. -- Josh - Original Message - From: "Sharique" <[EMAIL PROTECTED]> To: "jQuery (English)" Sent: Tuesday, April 22, 2008 12:22 PM Subject: [jQuery] searching css id Hi, What I'm trying to is that when there is c