title: How to display subtotal based on sumproduct of input quantity and price?
body: <p>So I am trying to display the subtotal of my appetizers section of the menu. Each appetizers item is $3 per guest but then i have to multiply that number by 1.25. </p>
  
  <p>For my JavaScript I tried this </p>
  
  <pre><code>var guestsQTY = document.getElementById('guests').value;
  var percentage = 1.25;
  
  function totalIt() {
    var input = document.getElementsByName("app");
    var appItemTotal = 0;
    var appSubTotal = (appItemTotal * guestsQTY * percentage);
    for (var i = 0; i &lt; input.length; i++) {
      if (input[i].checked) {
        appItemTotal += parseFloat(input[i].value);
      }
    }
    appSubTotal += (appItemTotal * guestsQTY * percentage);
    document.getElementById("total").value = "$" + appSubTotal.toFixed(2);
  }
  </code></pre>
  
  <p>and here is my HTML </p>
  
  <pre><code>&lt;fieldset&gt;
      &lt;h1&gt;Appetizers Selection - $3 per person &lt;/h1&gt;
      &lt;p style="font-size:15px;"&gt; *each selection of an appetizer is $3 per estimate number of guests&lt;/p&gt;
      &lt;label&gt;&lt;input type="checkbox" name="app" value="3" onclick="totalIt()" /&gt; Meat Pie - Flaky pastry filled with minced beef, onions and green peppers&lt;/label&gt;
      &lt;br&gt;&lt;br&gt;
      &lt;label&gt;&lt;input type="checkbox" name="app" value="3" onclick="totalIt()" /&gt; Chin Chin - Fried pastry chips&lt;/label&gt;
      &lt;br&gt;&lt;br&gt;
      &lt;label&gt;&lt;input type="checkbox" name="app" value="3" onclick="totalIt()" /&gt; Spring Rolls - Fried flour wrappings with tender-crisp vegetables filling&lt;/label&gt;
      &lt;br&gt;&lt;br&gt;
      &lt;label&gt;&lt;input type="checkbox" name="app" value="3" onclick="totalIt()" /&gt; Deviled Eggs - Stuffed eggs with yolk paste &amp; mayo topped with paprika&lt;/label&gt;
      &lt;br&gt;&lt;br&gt;
      &lt;label&gt;&lt;input type="checkbox" name="app" value="3" onclick="totalIt()" /&gt; Kelewele - Fried plantains seasoned with spices&lt;/label&gt;
      &lt;br&gt;&lt;br&gt;
      &lt;label&gt;&lt;input type="checkbox" name="app" value="3" onclick="totalIt()" /&gt; Kebab - Spicy meat skewers; choose your meat! (one meat per skewer)&lt;/label&gt;
      &lt;br&gt;&lt;br&gt;
      &lt;label&gt;
          Total Appetizers Costs:
          &lt;input value="$0.00" readonly="readonly" type="text" id="total" /&gt;
      &lt;/label&gt;
  &lt;/fieldset&gt;
  </code></pre>
  
  <p>So the expected output that I am trying to get would be something like 
   (appitem1 * guestsQTY * 1.25) + (appitem2 * guestsQTY * 1.25) </p>