This code will help you to understand how to conditionally hide the DOM elements.
DOM elements are hidden using the hidden attribute. You can conditionally use any .NET parameter to set this attribute to hide the DOM elements.
@page "/" <p hidden="@IsShow">I am Blazor</p> <button @onclick="@Show">Show/Hide</button>
@code { private bool IsShow {get;set;} = false; private void Show() { IsShow = !IsShow; } }
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
DOM elements are hidden using the hidden attribute. You can conditionally use any .NET parameter to set this attribute to hide the DOM elements.
need an explanation for this answer? contact us directly to get an explanation for this answer