<li>
<input type= "checkbox" name="paradigm" id="id_1" value="3"/>
<label for="name_3">foo</label>
</li>
<li>
<input type= "checkbox" name="paradigm" id="id_2" value="4"/>
<label for="name_4">bar</label>
</li>
Here is two checkbox. If I checked checkbox id_1, using jquery I want to read the label foo. If I checked both then it should be ['foo','bar'].
As long as the
<label>elements immediately follow their<input>elements, then you can do something like this:A better solution would be to set proper
forattributes on your label elements (i.e. make sure they match up with theidattributes on their checkboxes) and then: