MixPetrov,
data-maximum="125" data-minimum="10"
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(function() {
function mathC() {
var nmb = +this.dataset.nmb;
var ns = +this.value.replace(/\D/g, "") || 0;
ns = Math.ceil(ns / nmb) * nmb;
this.value = ns
}
function is() {
var maximum = +this.dataset.maximum;
var minimum = +this.dataset.minimum;
var ns = +this.value.replace(/\D/g, "") || 0;
if (ns > maximum) ns = maximum;
if (ns < minimum) ns = minimum;
this.value = ns;
}
var timer;
$('.quantity_cart [type="text"]').on("input", function() {
window.clearTimeout(timer);
var self = this;
timer = window.setTimeout(function() {
mathC.bind(self)();
is.bind(self)()
},1200)
})
});
</script>
</script>
</head>
<body>
<div class="quantity_cart">
<input type="text" name="product_id" size="2" value="20" data-maximum="125" quantity="125" data-minimum="10" data-nmb="10" type="text">
</div>
</body>
</html>