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 i
You can use filter for this:
$('#id').find('*').filter(function() {
return $(this).text() === 'John';
});
Edit: Just as a performance note, if you happen to know more about the nature of what you're searching (e.g., that the nodes are immediate children of #id), it would be more efficient to use something like .children() instead of .find('*').
Here's a jsfiddle of it, if you want to see it in action: http://jsfiddle.net/Akuyq/