I am currently using the javascript search method to replace some text in body text, as shown below.
Assume my html
<body>
<div> I am in body...</div>
</body>
Then I use the approach below
var body = $(body);
var text = body.html();
text = text.replace('I am in body...','Yes');
body.html(text);
But I could see a slow page search in browsers such as IE ..
Please suggest me improve this, and also please let me know if there are any plugins for searching and matching a string, even if it has any html tags. As below
<body>
<div><span>I </span> am in body...</div>
</body>
With the current method, I cannot match this.
If i use
$('*:contains("some search text string")');
It will also match DIV and BODY. But here I want to look for html text, not the parent element ... Thanks