How to find exact text with jQuery ?
I needed a way to find labels based on the text that they contained.? I thought about using :contains() for this, but in this particular case the text items I was searching on were names and I could have similar names that :contains() could incorrectly match on.? For instance, if I was searching for “School, Tim” and there was an item with the text “School, Timothy” I would get both items returned.? This is not the behavior I was looking for.
I decided to write a little custom selector to match on exact text.? Here is the code for the custom selector: