I am trying to do a search and replace of text that has the same name inside the body but it is partial working, some of the text is being replace, but then some of the old text still show up, not quite sure what is going on.
$(document).ready(function() {
$('*').each(function(){
if($(this).children().length == 0)
$(this).text($(this).text().replace("old text", "replace with new text"));
});
});
much help is appreciated
thanks