title: Declaring static variable in jquery
body: <p>Kindly guide me regarding declaring static variable in the following program.
  I want to increment value of the static variable lists.counter with click of button.
  But its not working.</p>
  
  <pre><code> &lt;%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
      CodeBehind="Default.aspx.cs" Inherits="finalspecific2_list._Default" %&gt;
  
  
     &lt;asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"&gt;
      &lt;script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src="Scripts/jquery-1.4.1.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
  
      $(document).ready(function lists() {
  
          var list = $('#myList li:gt(0)');
  
  
          list.hide();
          lists.counter = 0;
          var username = $("#&lt;%= uname.ClientID %&gt;").val();
          var pwd = $("#&lt;%= pwd.ClientID %&gt;").val();
  
  
          $("#&lt;%= Login.ClientID %&gt;").click(function () {
  
  
              lists.counter++;
  
  
              alert(lists.counter);
              lists.counter++;
  
  
          });
  
  
  
  
          $("#&lt;%= Button1.ClientID %&gt;").click(function () {
  
              {
  
                      alert(lists.counter);
  
  
  
                      }
  
  
  
  
                  });
      });
  
  
  
    &lt;/script&gt;
  
  &lt;/asp:Content&gt;
  &lt;asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"&gt;
  
  
  
  
  &lt;asp:Button ID="Login" runat="server" Text="Login" /&gt;
  &lt;asp:Button ID="Button1" runat="server" Text="Login" /&gt;
  
  
  
  
  
  &lt;/ul&gt;
  
  
  
  
  
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>lists.counter should increase when any of the button is clicked and should increament for the subsequent clicks. 
  Kindly guide in this matter. </p>