X10nD X10nD - 1 year ago 116
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 Source
var className = $('.myclass').attr('class');

should do the trick.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download