title: JQuery: getting the value/text/innerHtml of a checkbox in an ASP.NET CheckBoxList control
body: <p>I've got a bunch of checkboxes generated by an asp.net CheckBoxList control. I want to get the text the user sees next to the control on the page. </p>
  
  <p>With similar controls, like RadioButtonList, I've been able to get their values in jQuery by doing this:</p>
  
  <pre><code>var selected = $("input:checked[id*='" + Control.id + "']");
  </code></pre>
  
  <p>and then looping through and getting the value:</p>
  
  <pre><code>var whatIwant = selections[i].value;
  </code></pre>
  
  <p>(In this case, that "value" will be the text I want).</p>
  
  <p>But - CheckBoxList renders differently. For each ListItem there's not only the input, but an html  tag like so:</p>
  
  <pre><code>&lt;input id="ctl00_ContentPlaceHolder1_ConsultedList_0" type="checkbox" name="ctl00$ContentPlaceHolder1$ConsultedList$0" /&gt;
  &lt;label for="ctl00_ContentPlaceHolder1_ConsultedList_0"&gt;Other service providers&lt;/label&gt;
  </code></pre>
  
  <p>As you can see, the input tag itself, which is what my nice little jQuery query finds, doesn't include the info I want: "Other service providers". That's on the label tag.</p>
  
  <p>Can anyone think of a good solution for this - maybe a good way of making the CheckBoxList render the text I need in the input tag, or some clever jQuery to find the labels that correspond to the <em>selected</em> inputs? </p>