I've got a list of links that looks like this
- Item 1
- Item 2 (foo)
- Item 3
How do I get jQuery to remove the string " (foo)" from the link text?
I've got a list of links that looks like this
How do I get jQuery to remove the string " (foo)" from the link text?
$('a:contains(foo)').text(function(_, currentText){
return currentText.replace('foo', '');
});