Hide DIV with DropDownList

Sometimes we need to hide some static part of the view. With help comes by jQuery and CSS. First we need add script like below: $(‘.divrek’).hide(); $(‘.extensionFields’).change(function () { if ($(this).val() == ‘1’) { $(‘.divrek’).show(); } else { $(‘.divrek’).hide(); }; }; }); Use ordinary DropDownList with ignition CSS Class: extensionFields @Html.DropDownList(“Id”, null, htmlAttributes: new { […]