Bootstrap nested accordion font-awesome icons
I've a 3 level nested bootstrap accordion which is working fine, but I want a change in the panel-heading div where I can use a font-awesome icon fa fa-chevron-down when the accordion is opened (Without affecting the nested accordions) and fa fa-chevron-right when accordion is collapsed. I'm using this code to changing the icon: $('div.panel-collapse.collapse').on('shown.bs.collapse', function() { $(this).parent().find(".fa-chevron-right").removeClass("fa-chevron-right").addClass("fa-chevron-down"); $(this).parent().find('.panel-heading').css('background', '#0271BC'); }).on('hidden.bs.collapse