X10nD X10nD - 9 months ago 55
jQuery Question

Get class name using jQuery

I want to get the class name using jQuery

And if it has an id

<div class="myclass"></div>

Answer
var className = $('.myclass').attr('class');

should do the trick.