D
D
Dymok2018-01-21 18:38:24
JavaScript
Dymok, 2018-01-21 18:38:24

How to understand what is executed in a JS script when an element is clicked?

In general, there is a site with an adaptive menu that needs to be redone. With a width of <768px, the menu items change to a button, which, when clicked, displays a side menu. I made a new menu, I also replace the menu items with a button with a media query, but I don’t know how to change the button, by clicking on which the side menu will be displayed.
The question is, is it possible to somehow track what exactly is performed by clicking on the button? I found a js file that does this by exclusion, but no more (it seems that the mmenu library is used). In essence, you just need to change the button that performs a misunderstood function.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stalker_RED, 2018-01-21
@UnluckySerivelha

In firefox, this is very conveniently done: XKEc1Qp.png
In chrome, it's not so visual: https://developers.google.com/web/tools/chrome-dev...

D
Don2Quixote, 2018-01-21
@Don2Quixote

RMB, look at the element's code, SOURCES - you are looking for a file that contains the JS code that should be executed. Put a breakpoint on some line in a function / part of the code where the program will stop. (breakpoint is set by clicking on the line number). if the stop did not occur, then the code does not work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question