title: Change to total price field in not reflecting
body: <p>Below are my html code and onchange(). I am not getting any error message but the changes I require in the </p>
  
  <p>The html is for a shopping cart where there are columns for each product that is in the cart and the last column of each row is for the total price of the product which needs to be changed as we increase the quantity.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function WO() {
    var tbody = document.getElementById("cartSection");
  
    for (var i = 0; i &lt; tbody.rows.length; i++) {
      var row = tbody.rows[i];
      var qty = row.cells[3].childNodes[0].value;
  
      var price = row.cells[2].childNodes[0].nodeValue;
  
  
      var answer = (Number(qty) * Number(price)).toFixed(2);
      row.cells[5].childNodes[0].nodeValue = answer;
  
  
    }
    document.getElementById("inputNumber").onchange = function() {
      myFunction()
    };
  
    function myFunction() {
      row.cells[5].childNodes[0].nodeValue = (Number(qty) * Number(price)).toFixed(2);
    };
  };
  WO();</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="cart-section"&gt;
    &lt;table class="table cart-table table-responsive-xs striped-table"&gt;
      &lt;thead&gt;
        &lt;tr class="table-head"&gt;
          &lt;th scope="col"&gt;image&lt;/th&gt;
          &lt;th scope="col"&gt;product name&lt;/th&gt;
          &lt;th scope="col"&gt;price&lt;/th&gt;
          &lt;th scope="col"&gt;quantity&lt;/th&gt;
          &lt;th scope="col"&gt;action&lt;/th&gt;
          &lt;th scope="col"&gt;total&lt;/th&gt;
        &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody id="cartSection"&gt;
        &lt;tr&gt;
          &lt;td&gt;
            &lt;a href="#"&gt;&lt;img src="/web/product/89/1569065085-thumb.jpg" alt=""&gt;&lt;/a&gt;
          &lt;/td&gt;
          &lt;td&gt;&lt;a href="#"&gt;Black formal shoe&lt;/a&gt;
  
          &lt;/td&gt;
          &lt;td class="amount"&gt;
            449.00&lt;/td&gt;
          &lt;td&gt;
            &lt;input type="number" name="quantity" id="inputNumber" class="form-control input-number" value="2" onchange="myFunction"&gt;
          &lt;/td&gt;
  
          &lt;td&gt;&lt;a href="#" class="icon"&gt;&lt;i class="ti-close"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/td&gt;
          &lt;td class="totalprice"&gt;898.00&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;
            &lt;a href="#"&gt;&lt;img src="/web/product/94/1569065206-thumb.jpg" alt=""&gt;&lt;/a&gt;
          &lt;/td&gt;
          &lt;td&gt;&lt;a href="#"&gt;Slim brown leather shoe&lt;/a&gt;
  
          &lt;/td&gt;
          &lt;td class="amount"&gt;
            800.00&lt;/td&gt;
          &lt;td&gt;
            &lt;input type="number" name="quantity" id="inputNumber" class="form-control input-number" value="2" onchange="myFunction"&gt;
          &lt;/td&gt;
  
          &lt;td&gt;&lt;a href="#" class="icon"&gt;&lt;i class="ti-close"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/td&gt;
          &lt;td class="totalprice"&gt;1600.00&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;
            &lt;a href="#"&gt;&lt;img src="/web/product/93/1569065178-thumb.jpg" alt=""&gt;&lt;/a&gt;
          &lt;/td&gt;
          &lt;td&gt;&lt;a href="#"&gt;Dual Colour Formal&lt;/a&gt;
  
          &lt;/td&gt;
          &lt;td class="amount"&gt;
            500.00&lt;/td&gt;
          &lt;td&gt;
            &lt;input type="number" name="quantity" id="inputNumber" class="form-control input-number" value="2" onchange="myFunction"&gt;
          &lt;/td&gt;
  
          &lt;td&gt;&lt;a href="#" class="icon"&gt;&lt;i class="ti-close"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/td&gt;
          &lt;td class="totalprice"&gt;1000.00&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
  
    &lt;/table&gt;
  
    &lt;table class="table cart-table table-responsive-md"&gt;
      &lt;tfoot&gt;
        &lt;tr&gt;
          &lt;td&gt;total price :&lt;/td&gt;
          &lt;td&gt;
            &lt;h2&gt;$6935.00&lt;/h2&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tfoot&gt;
    &lt;/table&gt;
    &lt;div class="row cart-buttons"&gt;
      &lt;div class="col-6"&gt;&lt;a href="/site/index" class="btn btn-solid"&gt;continue shopping&lt;/a&gt;&lt;/div&gt;
      &lt;div class="col-6"&gt;&lt;a href="#" class="btn btn-solid"&gt;check out&lt;/a&gt;&lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>