title: automatically multiply two values to give a total jquery
body: <p>I have a jQuery question an was wondering if anyone could help me out. 
  I have an html table with information in it specifically for stones. I have a price per carat and a price per stone at the end of the table. I wish to have the price per carat multiply by the weight to give the price per stone. I also have a markup box that i have created in which the user inputs a number which is then regarded as a % and is automatically added to the price per carat and price per stone. here is what i have so far:</p>
  
  <p>Here is the jquery</p>
  
  <pre><code>jQuery(document).ready(function () {
  
      jQuery("#markup").keyup(multInputs);
  
      function multInputs() {
          var $inmult = jQuery(this).val();
  
  
          jQuery("tr").each(function () {
              var $val1 = jQuery('.price .amount', this).text().substring(1);
  
              var $mult = $inmult / 100;
              $mult += 1;
              var $total = $val1 * $mult;
  
  
  
              jQuery('.adjprice .amount', this).text("$" + $total.toFixed(2));
  
  
  
               $val1 = jQuery('.org_ct', this).text();
  
               $mult = $inmult / 100;
               $mult += 1;
               $total = $val1 * $mult;
  
  
  
              jQuery('.adj_ct', this).text($total.toFixed(2));
  
          });
  
  
      }
  }); 
  </code></pre>
  
  <p>Here is the HTML</p>
  
  <pre><code>&lt;span class="markup"&gt;Adjust Price: &lt;input name="markup" id="markup"&gt; % &lt;/span&gt;
  
  &lt;table id="myTable" class="tablesorter-blackice"&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Sku#&lt;/th&gt;
              &lt;th&gt;Availability&lt;/th&gt;
              &lt;th&gt;Cert #&lt;/th&gt;
              &lt;th&gt;Shape&lt;/th&gt;
              &lt;th&gt;Weight&lt;/th&gt;
              &lt;th&gt;Colour&lt;/th&gt;
              &lt;th&gt;Clarity&lt;/th&gt;
              &lt;th&gt;Cut&lt;/th&gt;
              &lt;th&gt;[MM]&lt;/th&gt;
              &lt;th style="display:none" class="header"&gt;US$/ct&lt;/th&gt;
              &lt;th class="header"&gt;US$/ct&lt;/th&gt;
              &lt;!--&lt;th&gt;CDN$/ct&lt;/th&gt;--&gt;
              &lt;th style="display:none" class="header"&gt;Hidden Orig Price&lt;/th&gt;
              &lt;th class="header"&gt;US$/St&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;rerew&lt;/td&gt;
              &lt;td&gt;erewr&lt;/td&gt;
              &lt;td&gt;wrer&lt;/td&gt;
              &lt;td&gt;ewrer&lt;/td&gt;
              &lt;td&gt;erwer&lt;/td&gt;
              &lt;td&gt;ere&lt;/td&gt;
              &lt;td&gt;ewr&lt;/td&gt;
              &lt;td&gt;ewrew&lt;/td&gt;
              &lt;td&gt;wreew&lt;/td&gt;
  
  
  
              &lt;td class="org_ct" style="display:none"&gt;
                  &lt;td class="adj_ct"&gt;1234&lt;/td&gt;
              &lt;/td&gt;
  
  
  
              &lt;td class="price" style="display:none"&gt;
                  &lt;td class="adjprice"&gt;
  &lt;span class="amount"&gt;&lt;/span&gt;
  
                  &lt;/td&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>The number is not automatically being multiplied to give me a price per stone. also the markup is not working either I really appreciate the help. THANKS!</p>