X10nD X10nD - 2 years ago 126
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