Reputation: 3856
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?
Upvotes: 0
Views: 96
Reputation: 58
another alternative
$('li:nth-child(2)').replaceWith('<li>Item 2</li>');
Upvotes: 0
Reputation: 144689
$('a:contains(foo)').text(function(_, currentText){
return currentText.replace('foo', '');
});
Upvotes: 3