Как сделать, чтобы при нажатии верх сумма умножалась, а при нажатии вниз делилась?
$("#kol").change(function() {
p = $(this).parent().parent();
kol = $("#kol").val();
sum = $("#sum").val();
mul = parseInt(sum * 2);
res = p.find("#sum");
res.html(mul);
total = 0;
$("span").text(mul);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js">
</script>
Количевство: <input type="number" id="kol" min="1" value="1" step="1"><br><br>
Сумма: <input type="number" id="sum" min="1" value="100" step="1">руб<br><br>
Общая сумма:<span></span>руб