我需要在jQuery中根据文本选择一个元素.
例如:
<span>this text</span>
Run Code Online (Sandbox Code Playgroud)
我知道我可以使用.contains()根据文本进行选择,但它并不是唯一的.
我不想选择:
<span>this text and that text</span>
Run Code Online (Sandbox Code Playgroud)
我想选择元素,如果它是元素的唯一文本.
除了使用正则表达式,我如何使用jQuery选择器?
谢谢.
jquery ×1