Just adding to Tony Miller's answer as this got me 90% towards what I was looking for but still didn't work. Adding .length > 0;
to the end of his code got my script working.
$(function() {
var foundin = $('*:contains("I am a simple string")').length > 0;
});