Chrome developer tools. DOM subtree modification breakpoint?

我的梦境 提交于 2019-12-10 04:36:59

问题


Will this break-point will only be invoked if nodes in sub-tree is added/removed, and not if they are simply modified?

As testing I tried to add class with JS to sub-tree elements, and the breakpoint did not invoke.

So just want to be sure, that only thing that will trigger this particular break-point is only addition/removal of sub-nodes, and not the modification of any f they're attributes or anything else for that matter, can anyone confirm this?


回答1:


Subtree modifications are node insertions and removals in the DOM [sub]tree rooted at the given node.

In order to break on the class attribute modifications you need to use... know what? Break on Attribute Modifications! :-)




回答2:


I can't add comments to your question, that's why I will post it as a new answer. Take a look here: how to set DOM Breakpoints in chrome

In general, open Chrome Developer Tools, select first tab called Elements, then find the element on which you want to put breakpoint, right click on it and a context menu with several options for a breakpoint will be opened. Options are:

  1. Break on Subtree Modifications
  2. Break on Attribute Modifications
  3. Break on Node Removal


来源:https://stackoverflow.com/questions/13933301/chrome-developer-tools-dom-subtree-modification-breakpoint

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!