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', '<strong>three</strong>'));
If it's not about the last word, but about the div's pure content try this:
var chld=$('div').children().clone();
$(div).children().remove();
//now do what You want with the text, eg.
$(div).html('<strong>'+$(div).text()+'</strong>'); //or something like that :)
$(div).prepend(chld); //This is a bottleneck, cause You have to know that
//all the text was after all the markup, but it refers to Your example.