nule,
Вариант...
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$.fn.replaceText = function (e, f, g) {
return this.each(function () {
var a = this.firstChild,
c, b, d = [];
if (a) {
do 3 === a.nodeType && (c = a.nodeValue, b = c.replace(e, f), b !== c && (!g && /</.test(b) ? ($(a).before(b), d.push(a)) : a.nodeValue = b));
while (a = a.nextSibling)
}
d.length && $(d).remove()
})
};
$(window).load(function () {
$('a').click(function(e){ alert('test') });
var a = ['слово1', 'слово2'];
var b = ['замена1', 'замена2'];
for( var i = 0; i < a.length; i++ )
$("body *").replaceText(new RegExp( a[i], "g" ), b[i]);
});
</script>
<title></title>
</head>
<body>
<p><a href="#">слово1 test слово1</a></p>
<b><a href="#">слово2</a></b>
<p><a href="#">слово1</a></p>
<i><b><a href="#">слово2</a></b></i>
</body>
</html>