Combining retrieved values with javascript and jquery
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1133770/how-do-i-convert-a-string-into-an-integer-in-javascript">How do I Convert a String into an Integer in JavaScript?</a>  </p>
</blockquote>



<p>I have a select element that contains options for products. What I want to achieve is when they pick an option the price on the page automatically adjusts. I have figured out how to retrieve those values but when I combine them it just puts two numbers together instead of actually adding them.</p>

<p>For example instead of outputting 60 when I have 50 + 10 it outputs 5010.</p>

<p>My code:</p>

<pre><code>$('.product_options').change(function(){
var base_price = $('#base_price').html();
var add_price = $(this).find("option:selected").data('price');

var new_price = base_price+add_price;

console.log(new_price);

$('.current_price').html(base_price+add_price);
</code></pre>

<p>});</p>

<p>Is there a way I can convert them both to integers so the operation actually goes through?</p>

<p>Thanks in advance!</p>
