I have a webpage, in which there are few elements and I've found using Chrome Developer Tools that an element is bound to onmousedown
event listener
For reference, this is the link to the webpage : http://zzzscore.com/1to50/en/
And in that page there are 25 blocks numbered from 1 - 25. The HTML code for the blocks is like this
<div style="opacity: 1;">
<span class="box" style="z-index:99"></span>
1
</div>
<div style="opacity: 1;">
<span class="box" style="z-index:90"></span>
2
</div>
and so on. Here I can't see any onmousedown
event being explicitly called, but the numbers get changed to other numbers on clicking them (some function should be doing this). Also, If I remove the event listener from chrome dev tools, no change happens on clicking (So somehow, the event is registered with the elements).
Basically, I'm writing a Javascript function to click these numbers but it's not working (Though it works for click on some other buttons). My code is something like this
var element = document.getElementsByTagName("div")[12]; // First block from the total 25 blocks
element.click();
So, how can I find on which element, I need to do the mouseDown/click task so that it works just like a regular mouse click?