jQuery
if ($('.panel a').hasClass('collapsed')) {
$('.panel a').addClass('no-print');
}
HTML
<div class="panel panel-default">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse1" class="collapsed">
</div>
I have my jQuery and HTML above, I wanted to add the no-print, which triggers the no-print CSS style that won't print its content... However, it's not working. Is my jQuery wrong?
I have followed this instruction:
- Check to see if href has class, if so, grab the id
- Determine if an element has a CSS class with jQuery
I don't know what else to do...