HVAC Load Calculator
label {
display: block;
margin-bottom: 10px;
font-weight: bold;
}
input[type=”number”] {
width: 100%;
padding: 5px;
margin-bottom: 10px;
}
button {
padding: 10px;
background-color: #007bff;
color: #fff;
border: none;
cursor: pointer;
}
const hvacForm = document.querySelector(‘#hvacForm’);
const result = document.querySelector(‘#result’);
hvacForm.addEventListener(‘submit’, function(e) {
e.preventDefault();
const surfaceArea = document.querySelector(‘#surfaceArea’).value;
const ceilingHeight = document.querySelector(‘#ceilingHeight’).value;
const numOccupants = document.querySelector(‘#numOccupants’).value;
const numDoors = document.querySelector(‘#numDoors’).value;
const numWindows = document.querySelector(‘#numWindows’).value;
const totalLoad = (surfaceArea * ceilingHeight) + (numOccupants * 100) + (numDoors * 1000) + (numWindows * 1000);
result.innerHTML = `The HVAC load is ${totalLoad} BTU.`;
});