Similar to Bojan's answer, I use this solution.
Change HTML code like this:
<span class="chevron_toggleable glyphicon glyphicon-chevron-down"></span>
It's better to use .on
event with respect to .click
. Also by using class selector it can be used as a site wide solution.
$('.chevron_toggleable').on('click', function() { $(this).toggleClass('glyphicon-chevron-down glyphicon-chevron-up');});