Asked • 04/15/19

Get class list for element with jQuery?

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.
Hello World!
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.

1 Expert Answer

By:

James C. answered • 04/10/20

Tutor
5 (14)

Computer Science Instructor | Here to Help with All Things Web!

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.