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