
$.fn.extend({ findReplace: function(find, replace) { $(this).text(function() { return $(this).text().replace(find, replace); }); } });
Usage
$('.selector').findReplace('This is replace', 'With This');
CodePen Example
See the Pen Replace Partial Text Using jQuery by Mike Doubintchik (@allurewebsolutions) on CodePen.