Font icon direction can not be converted?

<a class="glyphicon glyphicon-chevron-down" id="row"></a>

$("-sharprow").click(function(){
    $(this).toggleClass("glyphicon glyphicon-chevron-up");
})

Why can"t I change the direction of the arrow?


The use of

toggleClass is to remove the calss attribute if there is a class attribute in the selected page element, and to add the class attribute if there is no class attribute.

<a class="glyphicon glyphicon-chevron-down" id="row"></a>

$("-sharprow").click(function(){
    $(this).toggleClass('glyphicon glyphicon-chevron-up');
}) 

when clicked once, the code removes' glyphicon' and adds' glyphicon-chevron-up'
code to

.
<a class="glyphicon-chevron-down glyphicon-chevron-up" id="row"></a>

so the icon cannot be displayed

if you want to switch, you can change it to

.
$("-sharprow").click(function(){
    $(this).toggleClass('glyphicon-chevron-down glyphicon-chevron-up');
})
Menu