I was wondering if it was possible to find a label (or any element, really) by it's inner text. For example:
use the selector :contains()
var element = $("label:contains('SuperSweetCheckbox')");
The matching text can appear directly within the selected element, in any of that element's descendants, or a combination thereof. As with attribute value selectors, text inside the parentheses of
:contains() can be written as bare words or surrounded by quotation marks. The text must have matching case to be selected.