Tuesday, February 10, 2015

Jquery selector for the label of a checkbox

<input type="checkbox" name="filter" id="comedyclubs"/>
<label for="comedyclubs">Comedy Clubs</label>

$("label[for='comedyclubs']")

Reference:

http://stackoverflow.com/questions/1186416/jquery-selector-for-the-label-of-a-checkbox
http://docs.jquery.com/Selectors/attributeEquals#attributevalue

No comments: