KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I need to select an element based on its text in jQuery. For instance: <span>this text</span> I know I can use .contains() to select based on text, but it's not exclusive. I don't want to select: <span>this text and that text</span> I want to select the element if it's the only text of the element. Aside from using regex, how do I do this with jQuery selectors? Thanks.
Tags (comma-separated)
Save Edits
Cancel