I am trying to find and replace texts using jquery.
function replaceText() {
var jthis = $(this);
$("*").each(function() {
if(jthis.children().length==0) {
jthis.text(jthis.text().replace('nts:', 'nights:'));
}
});
}
$(document).ready(replaceText);
$("html").ajaxStop(replaceText);
here is my jsfiddle:
I need to replace the all "nts" texts on the page by "nights". Can you tell me why it's not working?