X10nD X10nD - 6 months ago 10
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.