I want to check if an element has a class specified or not (without knowing the class). For example, given:
<div id="ball" class="dd">
and:
<div id="ball">
I want to check if it has no class at all.
I know there is a function called hasClass
but this requires the class name to work.
EDIT
The question was answered in that other post. The answer which I found most useful was this:
$("#mydiv").prop('classList').length