Show and Hide DIV tag based on Checkbox selection using JQuery
There are situations where we need to show and hide div tag based on some conditions in client side.
The following code snippet will help us to hide and show a div tag based on checkbox selection using Jquery.
<script language="javascript">
function EnableDisableDIV() {
if ($("#chkShowPersonal").attr("checked")) {
$("#dvPersonal").show();
} else {
$("#dvPersonal").hide();
}
}
</script>
<asp:CheckBox ID="chkShowPersonal" onclick="EnableDisableDIV()" runat="server" />
<div id="dvPersonal" style="display:none">
<asp:TextBox ID="txtName" runat="server"></asp:TextBox>
</div>
|