I need to add and delete class on an element having multiple classes:
This is the html:
<div class="heading"> more html code here </div>
I want to add class and get value of the added class. Can I do this? If not, how can a new class be added or removed?
if ($(".heading").attr('class') == 'hidden') then $(".heading").removeClass('hidden');
else $(".heading").addClass('hidden');
Basically what I'm going to do is to toggle hide/show. I don't want to use toggle function as it mess up on table.