Is there a clever jQuery selector for selecting a text node like this:
one two three
//finds most inner element that has 'three' in it var el = $(':contains(three):last'); //actual replacement el.html(el.html().replace('three', 'three'));