jQuery selector for the label of a checkbox

This should work:

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

See also: Selectors/attributeEquals - jQuery JavaScript Library


$("label[for='"+$(this).attr("id")+"']");

This should allow you to select labels for all the fields in a loop as well. All you need to ensure is your labels should say for='FIELD' where FIELD is the id of the field for which this label is being defined.


This should do it:

$("label[for=comedyclubs]")

If you have non alphanumeric characters in your id then you must surround the attr value with quotes:

$("label[for='comedy-clubs']")

Another solution could be:

$("#comedyclubs").next()