$('a:contains(foo)').hide();
Done.
Or:
var customValue = "foo"
$('a').filter(function(){
return this.innerHTML === customValue;
}).fadeOut();
With the later option you custom it a lot more, like:
var customValue = "foo"
$('a').filter(function(){
return this.innerHTML === customValue &&
$(this).closest('div').length;
}).fadeOut();