var jx = jQuery.noConflict(); var output; jx(function() { jx(['h1', 'h2', 'h3','h3 a', '#nav a']).each(function(i, elem) { jx(elem).html(function(i, html) { output = ""; if(html.indexOf("®") != -1) { output = html.replace(/(®)/, "$1"); } else if(html.indexOf("™") != -1) { output = html.replace(/(™)/, "$1"); } else { output = html; } return output; }); }); });