I'm new on Jquery and I want to change the title style of my bootstrap accordion only when the accordion collapse (and comeback to my start style when the accordion is closed.
I want to change is 'font-weight' (light to bold) and the color of the title.
I tried to use only css using: .titleClass:collapsed {color: black; font-weight: bold; } but it act on the reverse : it puts my new style when closed and come to my original style when opened (how weird).
So I decided to use Jquery. Here is my stucking problem : With simple selectors I change the title style when collapsed but it doesn't want to come back to my original style when it's closed.
Many thanks for helping me on this. I put a jsfid on comment for whole code.
Here is my js :
$(function() {
$('#headingOne').click(function(){
$('.grey-letters').css({'font-weight':'bold', 'color':'black'});
});
if('.collapsed'){
$('.grey-letters').css({'font-weight':'100', 'color':'grey'});
}
});