title: how to use one method for all clickable items using jquery?
body: <p>What would be the best way to make the following jquery script into a single method which can be resued with all of my clickable spans? As you can see each click event is doing almost the exact same thing except for the specific CSS class and the spans unique ID. I have thought about using the jquery .children() method but I'm not sure how to assign the specific class to each span. Any help would be appreciated.</p>
  
  
          &nbsp;
  
  <pre><code>&lt;p class="clickHolder"&gt;
      &lt;span id="click1"&gt;Select Step 1&lt;/span&gt; 
      &lt;span id="click2"&gt;Select Step 2&lt;/span&gt; 
      &lt;span id="click3"&gt;Select Step 3&lt;/span&gt; 
      &lt;span id="click4"&gt;Select Step 4&lt;/span&gt; 
      &lt;span id="click5"&gt;Select Step 5&lt;/span&gt;
  &lt;/p&gt;
  &lt;script type="text/javascript"&gt;
      $(document).ready(function () {
          $("#click1").click(function () {
              $("#wizardSteps").removeClass();
              $("#wizardSteps").addClass("step1");
          });
  
          $("#click2").click(function () {
              $("#wizardSteps").removeClass();
              $("#wizardSteps").addClass("step2");
          });
  
          $("#click3").click(function () {
              $("#wizardSteps").removeClass();
              $("#wizardSteps").addClass("step3");
          });
  
          $("#click4").click(function () {
              $("#wizardSteps").removeClass();
              $("#wizardSteps").addClass("step4");
          });
  
          $("#click5").click(function () {
              $("#wizardSteps").removeClass();
              $("#wizardSteps").addClass("step5");
          });
  
      });
  &lt;/script&gt;
  </code></pre>