$(document).on('click', '.counter__minus', function() {
const parent = $(this).closest('.counter');
let count = +parent.find('input').val() - 1;
if (count <= 10) count = 10;
parent.find('input').val(count);
return
});
$(document).on('click', '.counter__plus', function() {
const parent = $(this).closest('.counter');
let count = +parent.find('input').val() + 1;
if (count <= 10) count = 10;
parent.find('input').val(count);
return
});
$(document).on('click', '.counter__count input', function() {
const parent = $(this).closest('.counter');
let count = +$(this).val();
if (count < 10 || !isNumeric(count)) {
parent.find('input').val(10)
}
return
});