title: jQuery counting elements by class - what is the best way to implement this?
body: <p>What I'm trying to do is to count all of the elements in the current page with the same class and then I'm going to use it to be added onto a name for an input form. Basically I'm allowing users to click on a <code>&lt;span&gt;</code> and then by doing so add another one for more of the same type of items. But I can't think of a way to count all of these simply with jQuery/JavaScript.</p>
  
  <p>I was going to then name the item as something like <code>name="whatever(total+1)"</code>, if anyone has a simple way to do this I'd be extremely grateful as JavaScript isn't exactly my native tongue.</p>