On Oct 30, 9:55 am, "Josh Nathanson" <[EMAIL PROTECTED]> wrote: > Is there a cool way to check if an object is a jQuery object as opposed to > any other object? > > I tried the constructor property but it just says Object(), the same as any > other object. > > Tried typeof, but same deal, just object. > > Right now my function can take an object or a jQuery object as an argument, > and all I've figured out is that the jQuery object is indexable > (array-like), so if the object is not jQuery it will return undefined if I > say obj[0]. But, this seems like a hack - is there a better way to test the > object's type? > > -- Josh
How about: if (obj.jquery) { // it is a jquery object - jquery holds the version } else { // not a jquery object }