Answer the question
In order to leave comments, you need to log in
How to click on all elements of the same class?
The site displays elements, among which there are elements with the class " ", how to click on all elements with this class at once? When executing this code, the click goes through only one element. If you execute this code several times through the browser console, then it will click on these elements in order.
var btn = document.getElementsByClassName('itemclass');
for(var i = 0; i < btn.length; i++)
btn[i].click();
Answer the question
In order to leave comments, you need to log in
Why cycle??????
var btn = document.getElementsByClassName("itemClass");
btn.click();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question