Skip to content

Instantly share code, notes, and snippets.

@kalley
Created June 29, 2012 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kalley/3019012 to your computer and use it in GitHub Desktop.
Save kalley/3019012 to your computer and use it in GitHub Desktop.
Find Labels
// Easily find all labels, or a filtered set of labels for the element
;(function($) {
$.fn.findLabels = function(filterSelector) {
filterSelector = filterSelector || '';
return $(document).find('label[for="'+this[0].id+'"]'+filterSelector);
};
}).call(this, jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment