title: Struts2 checkbox label to change with jquery
body: <p>I am using jquery to change the label of the checkboxes.</p>
  
  <pre><code>use strict';
  $("#chId").click(function () {
     if (this.checked) {
           $('#divId').html("Checked");
     }
     else{
           $('#divId').html("Un-Checked");
     }
  
  });
  </code></pre>
  
  <p>It works OK if I specify checkbox in regular html style</p>
  
  <pre><code>&lt;input type="checkbox" id="chId"/&gt; 
  &lt;div id='divId'&gt;Checked&lt;/div&gt;
  </code></pre>
  
  <p>There are several checkboxes and I am using different "divId" for each text to change
  However, I need to specify it with the struts checkbox tag with the "label" attribute.
  I know that when it's done like this, I will have label rendered on html as </p>
  
  <pre><code>&lt;label for"checkbox_class"&gt;Checked&lt;/label&gt;
  </code></pre>
  
  <p>And if if change jquery just a little to select by class "label" it will work</p>
  
  <pre><code>$('.label').html("Checked");
  </code></pre>
  
  <p>But, if I have multiple check boxes, all the labels would have the same class ".label" and I am not sure how to make different text by check box change not at the same time
  Basically, I want to either
     1) have 5 labels to all have different classes "label1", ... "label5" or
     2) have id on each label so that ... or
     3) be able to use "for" attribute in a jquery selector?
  I think #(3) is my best bet, but I don't know how to to do it.<br>
  Can anyone help ?
  Thanks</p>