title: jquery on link click add 1 to variable
body: <p>I'm trying to add 1 to a variable when a next button is clicked which will show a hidden previous button but I can't seem to get the add 1 part to work. I've pasted the code and a link to a jsfiddle below:</p>
  
  <p><a href="http://jsfiddle.net/huddds/JesBR/1/" rel="nofollow">http://jsfiddle.net/huddds/JesBR/1/</a></p>
  
  <p>HTML</p>
  
  <pre><code>  &lt;a href="#" class="prevButton"&gt;PREVIOUS&lt;/a&gt;
    &lt;a href="#" class="nextButton"&gt;NEXT&lt;/a&gt;
  </code></pre>
  
  <p>Javascript</p>
  
  <pre><code> nextClicked = 0;
   currentNextClicked = nextClicked;
  
   $(document).ready(function() {
  
       $('a.nextButton').live('click', function(){
           nextClicked = currentNextClicked + 1;
           return false;
       });
  
       if(nextClicked == 0){
           $('a.prevButton').hide();    
       }
       if(nextClicked == 1){
           $('.prevButtonFalse').hide();
           $('.prevButton').show();
  
       }
       if(nextClicked == 2){
  
       }
       if(nextClicked == 3){
  
       }
       if(nextClicked == 4){
  
       }
   });​
  </code></pre>
  
  <p>CSS</p>
  
  <pre><code> .nextButtonFalse{display:none;}
   .prevButtonFalse{display:none;}
  </code></pre>
  
  <p>Any help would be great, thanks in advance for any responses.</p>
  
  <p>I've decided to go with this option:</p>
  
  <p>HTML</p>
  
  <pre><code> &lt;div&gt;Total : &lt;span id="total"&gt;0&lt;/span&gt;&lt;/div&gt;
   &lt;input class="subtract" data-amount="1" type="button" value="PREVIOUS" /&gt;
   &lt;input class="add" data-amount="1" type="button" value="NEXT" /&gt;
  </code></pre>
  
  <p>jQuery</p>
  
  <pre><code> $(document).ready(function() {
     $('.add').click(function() {
        $('#total').text(parseInt($('#total').text()) + parseInt($(this).data('amount')));
     });
   })
  
  
   $(document).ready(function() {
     $('.subtract').click(function() {
        $('#total').text(parseInt($('#total').text()) - parseInt($(this).data('amount')));
     });
   })
  </code></pre>
  
  <p>​
  <a href="http://jsfiddle.net/huddds/JesBR/20/" rel="nofollow">http://jsfiddle.net/huddds/JesBR/20/</a>
  ​
  ​
              ​</p>