I am new to Javascript and I can't figure it out what I am doing wrong. I want to click dynamically on multiple buttons using javascript.
ClickMultipleButtons() {
const buttons = document.querySelectorAll('.cssClass');
for(let i = 0 ; i<= buttons.lenght; i++){
buttons[i].click();
}
}
I tried to access all the buttons using the querySelectorAll and after iterate the nodelist using a for loop in order to click all the buttons. Can you please help me understand what it's the problem?