$(".selector:contains('xx')")
contains() only performs matching search, which is not accurate enough. It contains the selector and xx of xx All selectors containing xxabc will be found.
Solution:
?$(".selector:contains('xx')[innerHTML='xx']")
This will find the selector whose content is only xx.