国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

How to switch classes in Blazor on button click?
P粉041881924
P粉041881924 2024-03-28 00:07:37
0
1
724

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');
}

P粉041881924
P粉041881924

reply all(1)
P粉269847997

No JavaScript required. You can do this the Blazor way.

DropDownComponent.razor

Debug: @buttonCss

@code { private string buttonCss = "glyphicon-chevron-right"; private void ChangeButtonClass() { buttonCss = buttonCss == "glyphicon-chevron-right" ? "glyphicon-chevron-up" : "glyphicon-chevron-right"; } }

Elsewhere in the app




Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template