What is wrong with next code?
<script>
const money = document.querySelector('h2 span')
const form = document.forms.deposit;
const initial = form.elements.initial
const period = form.elements.period
const program = form.elements.program
const totalMoney = () => {
if(Number(period.value) > 0 && Number(program.value) > 0) {
let initialNum = Number(initial.value);
let periodNum = Number(period.value);
let programNum = Number(program.value);
let perMonth = programNum / 12
money.innerHTML = initialNum + perMonth * periodNum * (initialNum / 100)
}
else
money.innerHTML = initial.value;
}
initial.addEventListener('input', () => {
totalMoney();
})
period.addEventListener('change', () => {totalMoney();})
program.addEventListener('change', () => {totalMoney();})
</script>