As said in the title, I'd like to find something like :contains() but to match an exact string. In other words, it shouldn't be a partial match. For example in this case:
<div id="id">
   <p>John</p>
   <p>Johny</p>
</div>
$("#id:contains('John')") will match both John and Johny, while I'd like to match only John.
Thanks in advance.
EDIT: ES2015 one-liner solution, in case anyone looked for it:
const nodes = [...document.querySelectorAll('#id > *')].filter(node => node.textContent === 'John');
console.log(nodes);/* Output console formatting */
.as-console-wrapper { top: 0; }
.as-console { height: 100%; }<div id="id">
  <p>John</p>
  <p>Johny</p>
</div> 
     
     
     
     
    