what i want to do is to click on this icons (there are like 16 per website, one by one, click the first, go to the next available, etc....
And sometimes it has this other eye icon: (it changes the code a bit)
I know we could do it from the console, but for comfort i would prefer to do this from the bookmarks (adding the code to a bookmark, then click it when i need it)
So, what i know (thanks to @Sphinx) is that we have to write in a bookmarkletjavascript:$("span.icon.icon_eye").click()
but the main problem is that when i click it, it clicks the first icon eye, and i need to click first the 1st eye icon, then the second, then the third, etc...
Based on your comments, below codes should be what you need.
bind click
event for all span.icon_eye
.
Click each <span class="icon icon_eys">
second by second (setTimeout).
function clickSomething() {
$('span.icon.icon_eye').on('click', function(){console.log('You clicked', $(this).html())});
$('span.icon.icon_eye').each(function(index){setTimeout(()=>{$(this).click()}, index*1000);});
}
setTimeout(clickSomething, 1000)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div>
<span class="icon icon_eye">A</span>
<span class="icon icon_eye">B</span>
<span class="icon icon_eye">C</span>
<span class="icon icon_eye">D</span>
<span class="icon icon_eye">E</span>
<span class="icon icon_eye">F</span>
</div>