Conversaciones » Desarrolladores
How to click on all anchor of same class on a page
[].forEach.call(document.querySelectorAll('.like-stream-item'),item=>item.click());
@indefined said:
[].forEach.call(document.querySelectorAll('.like-stream-item'),item=>item.click());
it works but as the click happen to all the class name changes from like-stream-item ** to **like-stream-item is-liked but it click on it too
before click its
<a href="#" class="like-stream-item " data-ember-action="" data-ember-action-319="319">
after click
<a href="#" class="like-stream-item is-liked" data-ember-action="" data-ember-action-319="319">
but the click code works again after class name is changed
@"Ankit Singh" 说道: before click its
<a href="#" class="like-stream-item " data-ember-action="" data-ember-action-319="319">
after click
<a href="#" class="like-stream-item is-liked" data-ember-action="" data-ember-action-319="319">
but the click code works again after class name is changed
[].forEach.call(document.querySelectorAll('.like-stream-item:not(.is-liked)'),item=>item.click());
How to click on all anchor of same class on a page
i want to click on all the anchor which have the same class as *like-stream-item * i tried few codes but only on click works not all