I am a jquery/javascript newbie. What I want to do is add a class to the open accordion title, and remove it when i open another.
heres the code:
&l
class active dont give the item becouse in less files this class changed you have to give it css instead class. this code is work best and you can add another css that you required
$(function () {
$('#accordion')
.on('show.bs.collapse', function (e) {
$(e.target).prev('.panel-heading').css({'background-color': 'red','color':'white'})
})
.on('hide.bs.collapse', function (e) {
$(e.target).prev('.panel-heading').css({ 'background-color': '#b6ff00', 'color': 'black' })
});
});