I\'m attempting to find a specific string in a document which potentially can have the text split by other tags (i.e. "< p > This is an < span > example < /s
This will get you started. You can use :contains() selector for finding string in html.
function getStringParent(str) {
return $("p:contains('"+ str +"')");
}
var parent = getStringParent('This is an example');
console.log('found ' + parent.length + ' items' + '\n');
console.log(parent);
This is an example