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.
Why has no one simply listed.
$(element).attr("class").split(/\s+/);
EDIT: Split on /\s+/ instead of ' ' to fix @MarkAmery's objection. (Thanks @YashaOlatoto.)
/\s+/
' '