<input type="checkbox" name="filter" id="comedyclubs"/>
<label for="comedyclubs">Comedy Clubs</label>
If I have a check box with a label describing it, how can I select the label using jQuery? Would it be easier to give the label tag an ID and select that using $(#labelId)
?
This should work:
$("label[for='comedyclubs']")
See also: Selectors/attributeEquals - jQuery JavaScript Library