title: jQuery spinner type thing
body: <p>I'm trying to create a jQuery spinner type thing earlier today somebody gave me this code which increases the text field value up/down on button clicks. Fantastic. But what do you do to disable the .desc button if the value is 0 - zero.  In PHP very easy if if &lt;=0 then this etc... but I don't know jQuery..</p>
  
  <p>Also any ideas how it can be used to move up/down an unordered html list i.e. ul li?</p>
  
  <pre><code>$(document).ready(function() 
  {   
      $(function()
      {
          $(".inc").click(function() 
          { 
              $(":text[name='qty']").val(Number($(":text[name='qty']").val()) + 1);
          }); 
  
          $(".dec").click(function()
          {      
              $(":text[name='qty']").val(Number($(":text[name='qty']").val()) - 1);
          });  
      });
  });
  </code></pre>
  
  <p>This uses a form:</p>
  
  <pre><code>&lt;input type="text" name="qty" value="0" /&gt;
  &lt;img src="img/up.png" class="inc" width="20px" height="9px" alt="Increase" title="increase" /&gt;
  &lt;img src="img/down.png" class="dec" width="20px" height="9px" alt="Decrease" title="Decrease" /&gt;
  </code></pre>