Note that there are some explanatory texts on larger screens.

plurals
  1. POusing jquery in asp.net to hide div tag
    primarykey
    data
    text
    <p>Greetings, I have asp.net check box control and asp.net dropdownlist control inside div tag.</p> <p>I want to hid the div when I check the box and unhide it when I unchecked the box.</p> <p>I tried few ways with jquery but I could not do it.</p> <p>Here is my code please look at it and tell me what is wrong with it.</p> <pre><code> &lt;%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="IMAM_APPLICATION.WebForm1" Title="Untitled Page" %&gt; &lt;asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"&gt; &lt;/asp:Content&gt; &lt;asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"&gt; &lt;script src="js/jquery-1.4.1-vsdoc.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function ModifyOccup() { $('myOccup').removeClass('display1'); $('myOccup').removeClass('display1'); $('myOccup').removeClass('display'); $('myOccup').removeClass('display'); if ($('#&lt;%=chkOccup.ClientID %&gt;').is(':checked')) { $('myOccup').addClass('display1'); } else { $('myOccup').addClass('display'); } } &lt;/script&gt; &lt;asp:CheckBox ID="chkOccup" runat="server" Style="top: 1055px; left: 355px; position: absolute; height: 22px; width: 126px" Text="Check to modify" onclick=" ModifyOccup()"/&gt; &lt;div id ="myOccup" &gt; &lt;asp:DropDownList ID="cmbWorkField" runat="server" Style="top: 1090px; left: 350px; position: absolute; height: 22px; width: 126px"&gt; &lt;/asp:DropDownList&gt; &lt;/div&gt; &lt;/asp:Content&gt; ...................... Style.css File .......................... .display { display: none; } .display1 { display: inherit; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload