const calcButton = document.querySelector("#calcButton") const baseElem = document.querySelector("#base") const heightElem = document.querySelector("#height") const areaElem = document.querySelector("#area") calcButton.addEventListener('click', () => { let base = Number(baseElem.value) let height = Number(heightElem.value) let area = base * height / 2 areaElem.value = area })