With an increase in the amount, the amount should increase, but at colivevism 10, if pressed down, the amount displays 300, but should output 100. How can I fix this?
$("#kol").change(function() { nV = $(this).val(); oV = this.name; this.name = nV; p = $(this).parent().parent(); kol = $("#kol").val(); showsum = $("#sum").val(); sum = $("#realsum").val(); if(nV > oV) { mul = parseInt(sum) + parseInt(showsum); } else { mul = parseInt(showsum) - parseInt(sum); } res = p.find("#sum"); res.html(mul); total = 0; $("#sum").val(mul); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"> </script> Количевство: <input type="number" id="kol" min="5" value="5" step="5"><br><br> Сумма: <input type="hidden" id="realsum" value="100"> <input type="text" id="sum" min="100" value="100"> руб
Количествоis count of bills? Why not just count the number by 100? - Mr. Black