I have an array like this
var words = [
{
word: \'Something\',
link: \'http://www.something.com\'
},
{
word: \'Something
It would be possible to do it with something like:
$('*:contains("string to find")');
the problem with this approach is that "*" will return all elements that contain the string, including HTML, BODY, etc... and after that you still need to find the string inside the text node of each element, so it may be easier to just go and check every text node...
I'd suggest you take a look at the highlight plugin that already does something very similar to what you want (instead of linking, it highlights any text on a page), but from the source code it seems pretty easy to change it.