I currently have an onclick event that switches classes like this:
.... <button id="@m.TargetCo.ButtonId" onclick="glyphChanger(this.id)" class="btn btn-default iconButton glyphicon glyphicon-chevron-right" ></button> .... function glyphChanger(buttonID) { $("#" + buttonID).toggleClass('glyphicon-chevron-right glyphicon-chevron-up'); }
No JavaScript required. You can do this the Blazor way.
DropDownComponent.razor
Elsewhere in the app