title: Show the total value of increase and decrease amount
body: <p>I am new to jQuery. I am trying to increase and decrease value on <code>click</code> on the button.
  Now I want to show  the sum of three input on total <code>input</code>. </p>
  
  <p>Here is what I tried : </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>var cartButtons = $('.cart-plus-minus').find('button');
  $(cartButtons).on('click', function(e) {
    e.preventDefault();
    var $this = $(this);
    var target = $this.parent().data('target');
    var target = $('#' + target);
    var current = parseFloat($(target).val());
    if ($this.hasClass('cart-plus-1'))
      target.val(current + 1);
    else {
      (current &lt; 2) ? null: target.val(current - 1);
    }
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>body {
    width: 500px;
    margin: 0 auto;
  }
  
  a {
    text-decoration: none;
    margin-bottom: 20px;
  }
  
  .cart-plus-minus {
    margin-top: 20px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;h1&gt;Increment / Decrement an 'amount' input.&lt;/h1&gt;
  
  &lt;a href="" class="a-link"&gt;
    &lt;label&gt; Total amount is: &lt;/label&gt;
    &lt;input type="text" placeholder="" value="0"&gt;
  &lt;/a&gt;
  &lt;div class="cart-plus-minus" data-target="amount-1"&gt;
    &lt;button class="btn cart-minus-1"&gt;-&lt;/button&gt;
    &lt;input type="number" id="amount-1" value="1" min="1" max="300"&gt;
    &lt;button class="btn cart-plus-1"&gt;+&lt;/button&gt;
  &lt;/div&gt;
  
  &lt;div class="cart-plus-minus" data-target="amount-2"&gt;
    &lt;button class="btn cart-minus-1"&gt;-&lt;/button&gt;
    &lt;input type="number" id="amount-2" value="1" min="1" max="300"&gt;
    &lt;button class="btn cart-plus-1"&gt;+&lt;/button&gt;
  &lt;/div&gt;
  &lt;div class="cart-plus-minus" data-target="amount-2"&gt;
    &lt;button class="btn cart-minus-1"&gt;-&lt;/button&gt;
    &lt;input type="number" id="amount-2" value="1" min="1" max="300"&gt;
    &lt;button class="btn cart-plus-1"&gt;+&lt;/button&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thanks in advance. </p>