Frequently Asked Questions
These questions are meant help you solve specific but common problems that may pop up when using this language. They are meant to be read after you have gone through the tutorial and begin actual development.
Many of these questions and answers are taken from the official jQuery faq maintained by the developers of jQuery. If you can't find the question(s) you are looking for on this page try searching through that page.
Many of these questions and answers are taken from the official jQuery faq maintained by the developers of jQuery. If you can't find the question(s) you are looking for on this page try searching through that page.
How do I test whether an element has a particular class?
hasClass (added in version 1.2) handles this common use case. You can also use the is() method along with an appropriate selector for more advanced matching:
How do I tell if an element exists after selected by a jQuery object?
Use the length property of the jQuery collection returned by your selector. In an if statement check the .length property of the jQuery collection.

