jquery find and replace text in variable code example
Example 1: jquery replace element
$("elementsSelector").replaceWith( "<h2>New content</h2>" );
Example 2: jquery replace text
$('#id1 p').each(function() {
var text = $(this).text();
$(this).text(text.replace('Kate', 'Nef'));
});