// JavaScript (calculator-script.js) document.addEventListener("DOMContentLoaded", function () { const maxWidth = 1200; const maxHeight = 1000; const customCalculator = document.getElementById("custom-calculator"); const gridLabelInput = customCalculator.querySelector("#grid-label"); const gridHeightInput = customCalculator.querySelector("#grid-height"); const errorMessage = customCalculator.querySelector("#error-message"); function validateInput() { const width = parseInt(gridLabelInput.value); const height = parseInt(gridHeightInput.value); if (width > maxWidth || height > maxHeight) { errorMessage.style.display = "block"; } else { errorMessage.style.display = "none"; } } gridLabelInput.addEventListener("input", validateInput); gridHeightInput.addEventListener("input", validateInput); });