document.addEventListener('DOMContentLoaded', function() { document.querySelector('#calculate-button').addEventListener('click', function() { const length = parseFloat(document.querySelector('#length-input').value); const width = parseFloat(document.querySelector('#width-input').value); const material = document.querySelector('#material-select').value; if (isNaN(length) || isNaN(width) || length <= 0 || width <= 0) { alert('Пожалуйста, введите правильные значения длины и ширины.'); return; } const area = length * width; const materialCost = material === 'material1' ? 500 : 700; // примерные цены const totalCost = area * materialCost; document.querySelector('#result').innerText = `Площадь: ${area.toFixed(2)} м²\nСтоимость: ${totalCost.toFixed(2)} рублей`; }); });

Полотно MSD Classic Китай

300,00
р.
1 м2