This tripped me up a while back too. You can use the is method to test
if an element is of a particular class.

$('div.foo').is('.bar')

The is method takes a simple selector and returns true or false.

Here are the docs for the is method:
http://jquery.bassistance.de/api-browser/#isString

--
Brandon Aaron

On 4/17/07, Geoffrey Knutzen <[EMAIL PROTECTED]> wrote:

How can I test if an element has a specific class?
If I have
<div class="foo bar">

How can I check if the element has class=bar

Seems like it should be easy, but I am having troubles.

Thanks
-Geoff


Reply via email to