Javascript / Jquery - Multiple on Change (function()
<p>I am kinda new to Jquery / JS and after a little help. I realise there hopefully is a much better way to do this, and any help would be greatly appreciated.</p>

<p>I am building a form that can calculate a total. That is:</p>

<p>'Cost' x '(1 + percent(%))' = 'total cost'</p>

<p>I have it working nicely, though I want to make it so that if I change either the '<strong>percent</strong>' field, or the '<strong>cost</strong>' field then the <strong>total amount</strong> updates. At the moment only if you update the '<strong>cost</strong>' will the <strong>total update</strong>.</p>

<p>Hope that makes sense. Code is below.</p>

<pre><code>$(document).ready(function(){

$("#cost").change(function() { 
var findprofit = parseFloat($("#cost").val());
var profit = (findprofit*.01)
var margin = parseFloat($("#percentage").val());
var total = profit*margin;
$(".profit_1_1").html(total);
var totalprofit = (total + findprofit);
$("#total").val(totalprofit);
});

&lt;input type="text" name="cost" id="cost"  /&gt;
&lt;input type="text" name="percentage" id="cost" percentage /&gt;
&lt;input type="text" name="total" id="total" readonly /&gt;
</code></pre>
