Reputation: 35689
$(this).html().replace("0 days","");
i want to replace "0 days" to become "". Currently the above statement will replace "0" to "" . that is not what i want. i want to replace entire statement "0 days"
Upvotes: 0
Views: 567
Reputation: 1038810
This will replace only the first occurrence. If you want to replace all occurrences:
$(this).html().replace(/0 days/g, '');
Example:
alert('foo 0 days bar 0 days foobar'.replace(/0 days/g, ''));
shows:
foo bar foobar
Upvotes: 3