itog = 0;
itog += 500;
Uncaught TypeError: Cannot read properties of null (reading 'innerText')
at HTMLInputElement.
Uncaught TypeError: Cannot set properties of null (setting 'textContent')
at HTMLFormElement.
const sumForm = document.forms.Sum;
const totalBlock = document.querySelector('#sum');
var currentSum = document.getElementById("sum");
const summ = Number(currentSum);
var baseValue = summ;
sumForm.addEventListener('change', () => {
const checkedImputsValues = Array.from(
document.querySelectorAll('.form-check-input:checked'),
input => Number(input.value)
);
const servicesSum = (checkedImputsValues.length !== 0)
? checkedImputsValues.reduce((a, b) => a + b)
: 0;
totalBlock.textContent = servicesSum + baseValue;
});