jQuery replace all instances of $0 on a page
I have a table of products in a cart. Wherever the price is set as $0 I
want to change it to TBC. I have used code as follows:
jQuery(document).ready(function() {
var replacedAmount = jQuery('body').html().replace('$0','TBC');
jQuery('body').html(replacedAmount);
});
I'm thinking there's some regex thing needed because of the $ but /$/
doesn't seem to do it.
No comments:
Post a Comment