title: Call a javascript function on RadioButton click
body: <p>I want the customer to be able to either buy phone line or credit.
  At first, both <code>div</code>s are hidden, and I want the related <code>div</code> to unhide (or <code>show</code>) when the customer chooses one purchase option.</p>
  
  <p>Here is my code, but nothing happens when I check one of the two radio buttons.
  I don't want the page to postback, so I cannot set <code>AutoPostBack="true"</code></p>
  
  <p>Any help on what I am doing wrong is really appreciated =)</p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript"&gt;
      $(document).ready(function () {
          $("#radLinePanel").click(chkPanelChanged);
          $("#radCreditPanel").click(chkPanelChanged);
       chkPanelChanged();
      });
  
      function chkPanelChanged() {
          if ($("#radLinePanel").is(':checked')) {
              $("#divLine").show("medium");
          }
          else {
              $("#divLine").hide("medium");
          }
          if ($("#radCreditPanel").is(':checked')) {
              $("#divCredit").show("medium");
          }
          else {
              $("#divCredit").hide("medium");
              }
      }
  &lt;/script&gt;
  
  
  &lt;div class="GreenPanel"&gt;
      &lt;div class="GreenPanelHeader"&gt;   
          &lt;asp:RadioButton ID="radLinePanel" runat="server" GroupName="ItemToBuy" Checked="false" Text="" ClientIDMode="Static"/&gt;
          Buy New Phone Line
      &lt;/div&gt;
      &lt;div id="divLine" class="GreenPanelContent" runat="server"&gt;
          Blablabla
      &lt;/div&gt;
  
      &lt;div class="GreenPanelHeader"&gt;                                               
          &lt;asp:RadioButton ID="radCreditPanel" runat="server" GroupName="ItemToBuy" Checked="false" Text="" AutoPostBack="false"/&gt;
          Buy credit                         
      &lt;/div&gt;
      &lt;div id="divCredit" class="GreenPanelContent" runat="server"&gt;
          Blablabla
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>