I am trying to hide a div which is easily done with hide function in jquery. But it is not working.The div is
<div id="antivirusAlertDiv"> <ul class="shielding_elements"> <li> <%= Html.RadioButton("antivirusAlertType", 0, antivirusAlertType == AntivirusAlertType.AlertMe ? true : false)%> <label for="id_4"> Alert Me</label> </li> <li> <%= Html.RadioButton("antivirusAlertType", 0, antivirusAlertType == AntivirusAlertType.DonotAlert ? true : false)%> <label for="id_5"> Don’t Alert</label> </li> </ul> </div> jquery code is:
function ShowAndHide(id, state) { var $mydiv = $('#antivirusAlertDiv'); if (state == false) { $mydiv.hide().html(''); // $('#uniform-antivirusAlertType').hide(); // $('#antivirusAlertDiv .shielding_elements li').hide(); // $("input[name='antivirusAlertType']").attr("disabled","disabled"); // $("#" + id).addClass("hide"); // $("#" + id).removeClass("show"); } else { $mydiv.show(); //$('#uniform-antivirusAlertType').show(); // $('#antivirusAlertDiv .shielding_elements li').show(); //$("input[name='antivirusAlertType']").removeAttr("disabled"); // $("#" + id).removeClass("hide"); // $("#" + id).addClass("show"); } }