See where the js code sets events for the html document

I have an html document and many js script files. How can I figure out where the js code sets an onclick event for an element? There are thousands of lines of code, and it all hurts a lot.

+3
source share
2 answers

Here is a simple solution:

  • In Google Chrome , go to Developer Tools ;
    • Menu> Tools>Developer Tools
    • Label the Windows: Maj+ CTRL+i
    • Label the X OS the Mac: Command+ Option+i
  • Then in the section " Elements" find the element you are interested in;
  • ; , , .. , , "Event Listeners"

.

, "Inspect Element"

enter image description here

+1

, : jQuery "DOM Mutation Events" ( " ".

.

jQuery, jQuery, , , .

: DOM

0

All Articles