title: JQuery not running simple function of multiply values
body: <p>I have a JQuery function, on which i am trying to simply apply the multiplication of 2 inputs onto a 3rd input.</p>
  
  <p>But, for some reason, it isn't working.
  What i basically want to do, is for the result to automatically appear on the 3rd input, after i have values on the first 2</p>
  
  <p>I tried searching for an answer, but maibe due to inexperience, i am unable to use the correct keywords. Sorry for that</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script src="https://code.jquery.com/jquery-1.10.2.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" &gt;
  $(document).ready(function () {
     $(".txtMult input").keyup(multInputs);
  
     function multInputs() {
         var mult = 0;
         // for each row:
         $("txtMult").each(function () {
             // get the values from this row:
             var $val1 = $('.val1', this).val();
             var $val2 = $('.val2', this).val();
             var $total = ($val1 * 1) * ($val2 * 1)
             $('.multTotal',this).text($total);
             mult += $total;
         });
      });
  
  
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div class="txtMult"&gt;
      &lt;div class="row"&gt;
          &lt;label for="name"&gt;Comprimento em centimetros:&lt;/label&gt;&lt;br /&gt;
          &lt;input id="cmp" class="val1" name="cmp" type="text" value="" size="30" /&gt;&lt;br /&gt;
      &lt;/div&gt;
      &lt;div class="row"&gt;
          &lt;label for="email"&gt;Largura em centimetros:&lt;/label&gt;&lt;br /&gt;
          &lt;input id="lrg" class="val2" name="lrg" type="text" value="" size="30" /&gt;&lt;br /&gt;
      &lt;/div&gt;
      &lt;div class="row"&gt;
          &lt;label for="email"&gt;Área em M&lt;small&gt;2&lt;/small&gt;&lt;/label&gt;&lt;br /&gt;
          &lt;div class='section'&gt;
          &lt;input id="lrg" class="multTotal" name="lrg" type="text" value="" size="30" /&gt;&lt;br /&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>