title: Increment counter ONLY once per item click
body: <p>The code below basically increments a counter whenever an item with single class is clicked. There are many items with single class.  What I need to do which I cannot figure out is how to make the counter increment once even though a single item has been clicked multiple times.    </p>
  
  <pre><code>var counter = parseInt($.trim($(".counter").html())); 
  items.click(function(){
      if($(this).hasClass("single")) { 
          $(this).addClass("selected");
          //increment counter            
          $(".counter").html(++counter);
  
          //if ($(this).hasClass("selected")) {               
          //    $(".counter").html(counter);
          // }
      }
      else { 
          return false;
      }
  
      return false;
  });
  </code></pre>