There is an element

enter image description here

His code

<div class="inline-block"> <span class="callback-block animate-load twosmallfont colored" data-event="jqm" data-param-id="19" data-name="callback">Заказать звонок</span> </div> 

By clicking on the item opens a pop-up form. enter image description here

How can I find out the event being executed by clicking. How can I trigger this event from code?

  • Well, look in the JS code where this event is, perhaps the event on the callback-block should be - Arsen
  • This is a pretty big site with a lot of script files - Kyper
  • Perhaps chrome devtools will help, highlight an element, and view event listeners. - Nikita R.
  • one
    In Mozilla, the console hangs icons for events that have one or another element, where you can see everything. - NeedHate
  • one
    Depending on the js code, there may be various search options. I think the real page here would help more than just html code. I usually include a stop in case of a change in the element attributes (break on attributes modifications) in the element tree in the developer tools. Once you understand how to start, you can also call. It could be something like $ (elem) .click () - holden321

2 answers 2

To define event handlers, it's convenient to use Chrome DevTools -> Sources> EventListener BreakPoints. In this case, you need to select "click" and click on the item under study.

Chrome DevTools. Event listener breakpoint

  • It seems to me an ambiguous answer. So I could not track exactly my event. The Mozilla version is more optimal so far - Kyper

I think this is the answer to your question.

enter image description here

enter image description here

The answer is on qaru.

Code:

 $(document).click(function(event){ // event.target is the clicked object }); $(document).click(function(event){ $(event.target).closest(".clickable").each(function(){ // "this" is your "clickable" clicked }); }); 
  • 2
    qaru answers are translations of answers to so :-) - Grundy
  • @Grundy, the circle is closed) - Dmytryk