Select the text nodes and update them instead. jsFiddle Demo
$(document).ready(function() {
$("a:contains('#OFN#')").contents().each(function(){
// skip if not a text node
if (this.nodeType != 3) {
return true;
}
this.nodeValue = this.nodeValue.substr(5);
$(this).before("<img src='/images/ofn_bullet.gif' width='10' height='10' style='width: 10px; height: 10px; border: none;' />");
});
});