Dave, That is great! Thanks.
I've tested it out with an array of 1000 names as a worst case
scenario and it is pretty slow. I'll have to see about refining the
list of names if possible to keep it as small as possible.

Thanks again,
Stephen

On Feb 23, 7:16 pm, Dave Stewart <[EMAIL PROTECTED]>
wrote:
> Heh heh, this is cool!
>
> var names = ['Stephen Boyd','Fred Von Brown']
> $("body").each(
> function(){
>     var html = $(this).html()
>     $(names).each(
>             function(i, e){
>                 var rx    = new RegExp(e, 'gi')
>                 html = html.replace(rx, '<a href="javascript:void(0);"
> onclick="alert(this.innerHTML)">' +e+ '</a>')
>                 }
>         )
>     $(this).html(html)
>     }
> )

Reply via email to