Check out the code snippet below, which involves the bootstrap accordion and showcases certain elements within the title section.
<dt><span><i class="fa fa-tachometer" aria-hidden="true"></i> Manage</span><i class="accordion_icon fa fa-chevron-up"></i></dt>
I am attempting to incorporate (icon, text, and background COLOR) using css .active and jquery..
Please refer to the following code...
<dt><span><i class="fa fa-tachometer" aria-hidden="true"></i> Settings</span><i class="accordion_icon fa fa-chevron-up"></i></dt>
<dd class="accordion_content">
<div class="list-group">
<a href="#" class="list-group-item list-group-item-action"><i class="fa fa-user" aria-hidden="true"></i> Members</a>
<a href="#" class="list-group-item list-group-item-action"><i class="fa fa-clipboard" aria-hidden="true"></i> Posts</a>
<a href="#" class="list-group-item list-group-item-action"><i class="fa fa-comments" aria-hidden="true"></i> Comments</a>
<a href="#" class="list-group-item list-group-item-action "><i class="fa fa-user-secret" aria-hidden="true"></i> Privacy</a>
<a href="#" class="list-group-item list-group-item-action "><i class="fa fa-bell" aria-hidden="true"></i> Notifications</a>
<a href="#" class="list-group-item list-group-item-action "><i class="fa fa-envelope" aria-hidden="true"></i> Emails</a>
<a href="#" class="list-group-item list-group-item-action "><i class="fa fa-globe" aria-hidden="true"></i> Sites Infor</a>
</div>
</dd>
Regarding css..
.active{
color:blue;
background-color:red;
}
And in jquery
jQuery('.accordion dt').click(function() {
jQuery(this).find('i').toggleClass('fa-chevron-up fa-chevron-down ').closest('dt').next()
.slideToggle().siblings('.accordion_content').slideUp();
});
jQuery('.accordion_content').hide();
My query is how can I write additional code to enable changing (icon, text, and background color) when a user clicks on the title name ..