Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find out what's preventing a click from happening?

I have the following link on the page:

<a href="/go/some/where.htm">...</a>

It lives among HTML that makes up a google.maps.InfoWindow box (which itself doesn't have a click event). This infobox comes up when the user moves the mouse over a mapping pin. For whatever reason, when the user clicks on a link in the infobox, it doesn't fire and I am trying to find out why.

The code base is huge and I have no idea where exactly the preventDefault or propagation is stopped. Is there an easier way? Can I hook into the event flow some way that would show me what is preventing the click?

like image 470
AngryHacker Avatar asked Jan 02 '23 12:01

AngryHacker


1 Answers

In addition the JavaScript debugger that Wyatt mentioned, you can check the Event Listener on any DOM element in Chrome Developer Tools. Right-click the element > Inspect: Select the Event Listeners tab on the right.

enter image description here

like image 173
Adrian J. Moreno Avatar answered Jan 05 '23 14:01

Adrian J. Moreno