Within my interface, I have a series of buttons with the following structure:
<button id="btn1" type="button" class="btn btn-default btn-sm margin-left-1">
<span class="glyphicon glyphicon-chevron-down"></span>
</button>
<button id="btn2" type="button" class="btn btn-default btn-sm margin-left-1">
<span class="glyphicon glyphicon-chevron-down"></span>
</button>
...and so on
I am looking for a way to dynamically remove the CSS class glyphicon-chevron-down
upon button click and replace it with glyphicon-chevron-up
. This is for a Twitter Bootstrap collapsing feature but I want to display an icon on the button itself. The ID can be embedded either in the button tag or the span tag without affecting functionality. Is there a method to check for applied CSS?