JQuery - Get the CSS class of an element -
i have anchor follows:
<a href="#" class="menu">text</a>
how can css class of anchor using jquery?
so in case "menu".
i able add , remove css classes can't find way css classes of element. can ?
use the native property :
$(selectororelement).get(0).classname
note it's answered use attr('class')
. not there no gain in using complex function instead of native dom property it's also, quite naturally, slower. see jsperf
Comments
Post a Comment