I am creating a pricing interface that will ultimately yield two different prices for the user (experience + collection). I will need to then combine these prices in order to display a total price. The experience and collection prices are being displayed depending on the selections the user makes, and they currently work great.
But now I can't figure out how to add the html values of the two html elements. The class total-cost is where this added value should display. I've tried quite a few things in hopes of figuring it out myself, but no luck.
Thanks!
HTML (cleaned up)
<div class="pricing-experience">
<div class="flex_column">
<span class="cost1">3000</span>
</div>
<div class="flex_column">
<span class="cost1">4000</span>
</div>
<div class="flex_column">
<span class="cost1">5000</span>
</div>
</div>
<div class="pricing-collection">
<div class="flex_column">
<span class="cost2">300</span>
</div>
<div class="flex_column">
<span class="cost2">450</span>
</div>
<div class="flex_column">
<span class="cost2">700</span>
</div>
</div>
<div class="experience-cost">
//cost1's value
</div>
<div class="collection-cost">
//cost2's value
</div>
<div class="total-cost">
//cost1 and cost2's added value
</div>
jQuery
$('.pricing-experience, .pricing-collection').on('click', '.flex_column', function() {
var experienceCost = $(this).find('.cost1').html(),
collectionCost = $(this).find('.cost2').html();
$(this).addClass('elephant').siblings().removeClass('elephant');
// console.log(experienceCost);
// console.log(collectionCost);
$('.experience-cost').html(experienceCost);
$('.collection-cost').html(collectionCost);
$('.total-cost').html(experienceCost + collectionCost);
});