function calculateTip(event) {
event.preventDefault();
let bill = document.getElementById('bill').value;
let serviceQual = document.getElementById('serviceQual').value;
let numOfPeolpe = document.getElementById('people').value;
if(bill == ' ' | serviceQual == 0){
alert("Por favor, preencha corretamente os campos!")
return;
}
if(numOfPeolpe == ' ' | numOfPeolpe <= 1){
numOfPeolpe = 1;
document.getElementById('each').style.display = "none";
} else {
document.getElementById('each').style.display = "block";
}
let total = (bill * serviceQual) / numOfPeolpe;
total.toFixed(2);
document.getElementById('tip').innerHTML = total;
document.getElementById('totalTip').style.display = "block"
}
document.getElementById('totalTip').style.display = "none";
document.getElementById('each').style.display = "none";
document.getElementById('tipsForm').addEventListener('submit', calculateTip);
Consta o seguinte erro no console do navegador na linha 28: Uncaught TypeError: Cannot read properties of null (reading 'addEventListener').