Saloni Parekh Saloni Parekh - 4 years ago 136
HTML Question

Jquery - how to get class name of div?

I am using this div in my layout. I am new to jQuery. So I want to know class name of div.

<div class="demo"></div>

Any help is much appreciated. Thanks.

Answer Source

Use this code

 var className = $('.demo').attr('class');

You can refer here,

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