I have a simple JS event:
var changeAddress = document.getElementsByClassName('modal-open');
if (changeAddress.length) {
var a = 0;
while (a < changeAddress.length) {
changeAddress[a].addEventListener('click', function () {
console.log(this); // Here i want to get classList
document.querySelector('.modal').removeAttribute('hidden');
});
a++;
}
}
How can I get classList from this
?
It's not necessary get it from this
or throw classList
. I just want to get all class names of element on which event is triggered. Thanks!