Можете подсказать в где ошибка, начинает считать после второго клика на +
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<div class="content">
<input type="text" value="200" class="price">
<button class="minus value-control" data-action="minus" data-target="quantity" data-cart-id="1">- </button>
<input type="text" value="1" id="quantity" min="1" max="10" class="quantity">
<button class="plus value-control" data-action="plus" data-target="quantity" data-cart-id="1"> + </button>
<span class="total">200</span>
</div>
<div class="content">
<input type="text" value="200" class="price">
<button class="minus value-control" data-action="minus" data-target="quantity" data-cart-id="1">- </button>
<input type="text" value="1" id="quantity" min="1" max="10" class="quantity">
<button class="plus value-control" data-action="plus" data-target="quantity" data-cart-id="1"> + </button>
<span class="total">200</span>
</div>
<script>
$(function () {
$(".content").each(function (indx, el) {
$(el).on('click', '.value-control', function (event) {
var total = (parseInt($(".quantity", el).val()) * parseInt($(".price", el).val()));
$('.total', el).text(total);
var action = $(this).attr('data-action');
var target = $(this).attr('data-target');
var id = $(this).attr("data-cart-id");
var value = parseFloat($('[id="' + target + '"]', el).val());
if (action == "plus") {
value++;
}
if (action == "minus") {
value--;
}
$('[id="' + target + '"]', el).val(value)
});
});
});
</script>