Калькуляция поля с отбором html
Имеется popup окно со следующим кодом:
<div class="modal fade" id="productModal" tabindex="-1" aria-labelledby="productModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
<div class="modal-header">
<div class="modal-title">
Для оформления заказа, заполните, пожалуйста данные
</div>
</div>
<div class="modal-body">
<form id="productform">
<input type="text" name="name" placeholder="ваше имя" required>
<input type="email" name="email" placeholder="ваш e-mail" required>
<input type="text" id="two" oninput="mult()" name="quantity" placeholder="укажите желаемое количество" required>
<input type="text" id="result" placeholder="сумма" required>
<script>
function mult() {
var second = document.getElementById('two').value;
document.getElementById('result').value = second * 9200;
}
</script>
<input type="tel" name="phone" class="phone" placeholder="+ 7 (999) 999-99-99" required>
<textarea name="text" id="" cols="30" rows="5" placeholder="Введите текст"></textarea>
<button type="submit" class="my_btn">Отправить</button>
<div class="response-output"></div>
</form>
</div>
</div>
</div>
</div>
Где интересует функция mult:
<script>
function mult() {
var second = document.getElementById('two').value;
document.getElementById('result').value = second * 9200;
}
</script>
Подскажите, пожалуйста, как реализовать функцию таким образом, чтобы: если вводится значение до 10, то умножение на 1000, если от 10 до 50, то умножение на 800 и если от 50 до 100, то на 600?
Источник: Stack Overflow на русском