I'm building a string of amounts but need to remove the dollar signs. I have this jQuery code:
buildList($('.productPriceID > .productitemcell'), 'pricelist')
It's returning
pricelist=$15.00,$19.50,$29.50
I need to remove the dollar signs but can't seem to figure it out. Tried using .trim but I think that removes only white space.
Sorry for the newbie question! Thanks in advance for any help!
Here's the full code:
function buildList(items, name) {
var values = [];
items.each(function() {
values.push(this.value || $(this).text());
});
return name + '=' + values.join(',');
}
var result = [
buildList($('.productCodeID > .productitemcell'), 'skulist'),
buildList($('.productQuantityID > .productitemcell > input'), 'quantitylist'),
buildList($('.productPriceID > .productitemcell'), 'pricelist')
];
var string = result.join('&');
Here is the raw code before the javascript runs
<span class=productPriceID>
<div class=productitemcell>$15.00</div>
<div class=productitemcell>$19.50</div>
<div class=productitemcell>$29.50</div>
</span>