<div class="wrap-input100 validate-input" data-validate="Name is required">
<input class="input100" type="number" min="2" max="144" name="core" required placeholder="Количество ядер (2-144 шт.)">
<span class="focus-input100"></span>
</div>
document.querySelectorAll('input[type="number"]').forEach(input => {
input.addEventListener('input', () => {
if (input.value !== '') {
const min = input.min !== '' ? Number(input.min) : -Infinity;
const max = input.max !== '' ? Number(input.max) : Infinity;
const value = Number(input.value);
input.value = Math.max(min, Math.min(value, max));
}
});
});