столкнулся с тем что при вызове метода консоль выдает ошибку: Uncaught TypeError: Cannot read property 'classList' of undefined
объект создан через new, метод вызван через eventListener
полный код класса: https://jsfiddle.net/Genry__12_Oz/owak6j98/2/
closeForms() {
// обнуляю кнопку submit
this.popUpButton.classList.remove('popup__button_content'); // почему popUpButton undefined?
this.popUpButton.classList.remove('popup__button_edit'); // дольше во всех this. такая же ошибка
this.popUpButton.classList.remove('popup__button_valid');
// обнуляю ошибки валидации
nameError.textContent = '';
aboutError.textContent = '';
// обнуляю условие
this.inputName.removeAttribute('minlength');
this.inputName.removeAttribute('maxlength');
// здесь тоже
this.inputAbout.removeAttribute('minlength');
this.inputAbout.removeAttribute('maxlength');
// обнуляю тип
this.inputAbout.removeAttribute('type');
// обнуляю name
this.form.removeAttribute('name');
}
setEventListener() { this.closeButton .addEventListener('click', this.closeForms); }
вызывается по клику ссылаться должен на этот объект по сути