Is there an “exists” function for jQuery?

How can I check the existence of an element in jQuery?

The current code that I have is this:

Is there a more elegant way to approach this? Perhaps a plugin or a function?


Yes!

This is in response to: Herding Code podcast with Jeff Atwood