Get Class List for Element with JQuery

Posted by Buggabill on Stack Overflow See other posts from Stack Overflow or by Buggabill
Published on 2009-08-04T12:41:04Z Indexed on 2010/03/23 12:03 UTC
Read the original article Hit count: 386

Filed under:
|

Is there a way in JQuery to loop through or assign to an array all of the classes that are assigned to an element?

ex.

<div class="Lorem ipsum dolor_spec sit amet">Hello World!</div>

I will be looking for a "special" class as in "dolor_spec" above. I know that I could use hasClass() but the actual class name may not necessarily be known at the time.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about html