Reputation: 8362
I am parsing JSON in jquery and i wish to remove some text from the "name" field on a certain element.
I am trying the following code but it doesn't seem to work:
$('#content ul li:contains("Industrial Average")').replace("");
Here is a fiddle to the code:
Upvotes: 0
Views: 104
Reputation: 382656
Try:
$('#content ul li:contains("Industrial Average")')
.html($('#content ul li:contains("Industrial Average")')
.text().replace("Industrial Average", ""));
Upvotes: 1