Как можно вот это вот сократить?
И заменить эту конструкцию (которая я знаю не работает):
document.getElementById('2btn', '3btn', '4btn', '5btn', '6btn').classList.remove('disabled');
___________
<script>
document.getElementById('1btn').onclick = function() {
document.getElementById('1btn').classList.add('disabled');
document.getElementById('2btn', '3btn', '4btn', '5btn', '6btn').classList.remove('disabled');
document.getElementById('monoprice').innerHTML = '300 €';
document.getElementById('biloprice').innerHTML = '350 €';
document.getElementById('trilo1price').innerHTML = '400 €';
document.getElementById('trilo2price').innerHTML = '440 €';
document.getElementById('petrprice').innerHTML = '640 €';
document.getElementById('marinaprice').innerHTML = '1000 €';
}
document.getElementById('2btn').onclick = function() {
document.getElementById('2btn').classList.add('disabled');
document.getElementById('1btn', '3btn', '4btn', '5btn', '6btn').classList.remove('disabled');
document.getElementById('monoprice').innerHTML = '350 €';
document.getElementById('biloprice').innerHTML = '400 €';
document.getElementById('trilo1price').innerHTML = '500 €';
document.getElementById('trilo2price').innerHTML = '560 €';
document.getElementById('petrprice').innerHTML = '850 €';
document.getElementById('marinaprice').innerHTML = '1300 €';
}
document.getElementById('3btn').onclick = function() {
document.getElementById('3btn').classList.add('disabled');
document.getElementById('1btn', '2btn', '4btn', '5btn', '6btn').classList.remove('disabled');
document.getElementById('monoprice').innerHTML = '500 €';
document.getElementById('biloprice').innerHTML = '650 €';
document.getElementById('trilo1price').innerHTML = '800 €';
document.getElementById('trilo2price').innerHTML = '950 €';
document.getElementById('petrprice').innerHTML = '1300 €';
document.getElementById('marinaprice').innerHTML = '1700 €';
}
document.getElementById('4btn').onclick = function() {
document.getElementById('4btn').classList.add('disabled');
document.getElementById('1btn', '2btn', '3btn', '5btn', '6btn').classList.remove('disabled');
document.getElementById('monoprice').innerHTML = '700 €';
document.getElementById('biloprice').innerHTML = '900 €';
document.getElementById('trilo1price').innerHTML = '1050 €';
document.getElementById('trilo2price').innerHTML = '1250 €';
document.getElementById('petrprice').innerHTML = '1900 €';
document.getElementById('marinaprice').innerHTML = '2250 €';
}
document.getElementById('5btn').onclick = function() {
document.getElementById('5btn').classList.add('disabled');
document.getElementById('1btn', '2btn', '3btn', '4btn', '6btn').classList.remove('disabled');
document.getElementById('monoprice').innerHTML = '900 €';
document.getElementById('biloprice').innerHTML = '1100 €';
document.getElementById('trilo1price').innerHTML = '1300 €';
document.getElementById('trilo2price').innerHTML = '1500 €';
document.getElementById('petrprice').innerHTML = '2200 €';
document.getElementById('marinaprice').innerHTML = '2700 €';
}
document.getElementById('6btn').onclick = function() {
document.getElementById('6btn').classList.add('disabled');
document.getElementById('1btn', '2btn', '3btn', '4btn', '5btn').classList.remove('disabled');
document.getElementById('monoprice').innerHTML = '1100 €';
document.getElementById('biloprice').innerHTML = '1300 €';
document.getElementById('trilo1price').innerHTML = '1500 €';
document.getElementById('trilo2price').innerHTML = '1800 €';
document.getElementById('petrprice').innerHTML = '2400 €';
document.getElementById('marinaprice').innerHTML = '3000 €';
}
</script>
Примечание:
HTML:
<div class="choosedt">
<p>
<span>Выбрать дату заезда:</span>
<button class="btn btn-mini" id="1btn">22.09 - 25.05</button>
<button class="btn btn-mini" id="2btn">25.05 - 15.06<br>07.09 - 21.09</button>
<button class="btn btn-mini" id="3btn">15.06 - 06.07<br>31.08 - 07.09</button>
<button class="btn btn-mini" id="4btn">06.07 - 27.07<br>24.08 - 31.08</button>
<button class="btn btn-mini" id="5btn">27.07 - 10.08<br>17.08 - 24.08</button>
<button class="btn btn-mini" id="6btn">10.08 - 17.08</button>
</p>
</div>