What is the best way to determine which javascript code that modifies certain html content on a page

I have a tag <p>on my webpage and I'm trying to figure out which JavaScript function is adding text inside this element, is there any specific way in chrome to add a listener to this tag to find out which script that is writing this tag?

+4
source share
1 answer

The most direct (low-noise) method uses a synchronization pause, which allows you to pop a call stack as a whole:

  • Open chrome devtools.
  • Right-click an item in the Devtools Items tab to open the context menu.
  • Break On... > Subtree Modifications.

"innerHTML" script , "", , DOM.

DOM, , setTimeout , , , , "" .

+3

All Articles