title: jQuery drop down list, on change do
body: <p>I have a dropdownlist with two values: Sponsor and Social_Worker. All I want to do is that when one of them is selected it shows one div and hides another, and vice versa if the other is selected. I managed to do this with buttons, but can't find the proper command to do it with a dropdownlist, the only information I am finding is getting the selected value.</p>
  
  <p>Buttons jquery (this is working):</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function () {
      var det = $("#SponsorDetails");
      var all = $("#AllDetails");
      $(all).hide();
      $(det).hide();
  
      $("#Social_WorkerButton").click(function (e) {
          e.preventDefault();
          $("#AllDetails").show("slow");
          $("#SocialWorkerSubmit").show("slow");
          $("#SponsorDetails").hide("slow");
      });
      $("#SponsorButton").click(function (e) {
          e.preventDefault();
          $("#AllDetails").show("slow");
          $("#SponsorDetails").show("slow");
          $("#SponsorSubmit").show("slow");
      });
  });
  </code></pre>
  
  <p></p>
  
  <p>I tried using:</p>
  
  <pre><code>$("#SelectAccount").change(function (e) {
          e.preventDefault();
          $("#SponsorDetails").show("slow");
          $("#SponsorSubmit").show("slow");
      });
  </code></pre>
  
  <p>HTML of DropDownList:</p>
  
  <pre><code>&lt;asp:DropDownList ID="SelectAccount" runat="server"&gt;
          &lt;asp:ListItem&gt;Sponsor&lt;/asp:ListItem&gt;
          &lt;asp:ListItem Value="Social_Worker"&gt;Social Worker&lt;/asp:ListItem&gt;
      &lt;/asp:DropDownList&gt;
  </code></pre>
  
  <p>Just to see if any change to the dropdownlist does anything, but this doesn't seem to work.</p>