Tengo esta lista desplegable:
<div class="form-group" id="businessEntitiesIdsLegal"> <label asp-for="BusinessEntityTypeId" class="control-label col-sm-4 col-lg-3" asp-show-required-charachter="true">Some label</label> <div class="col-sm-5 col-md-4 col-lg-3"> <select asp-for="BusinessEntityTypeId" id="BusinessEntityTypeId" asp-items="Model.BusinessEntities" class="select2 select-block-level search"> <option value="@BaseViewModel.NotSelected">Choose something</option> </select> <span asp-validation-for="BusinessEntityTypeId" class="text-danger"></span> </div> </div>y me gustaría manejar si su elemento seleccionado con valor = 2 luego mostrar este div (y también si el elemento se cambia, para ocultar el div):
@if(Model.BuyerTypeId == BuyerTypeEnum.Legal.Id) { <div class="form-group" id="foobar"> <label asp-for="Jbkjs" class="control-label col-sm-4 col-lg-3"></label> <div class="col-sm-5"> <input asp-for="Jbkjs" type="text" class="form-control" maxlength="5"> <span asp-validation-for="Jbkjs" class="text-danger"></span> </div> </div> }¿Cómo puedo conseguir esto?