问题
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:
- Break on Subtree Modifications
- Break on Attribute Modifications
- Break on Node Removal
来源:https://stackoverflow.com/questions/13933301/chrome-developer-tools-dom-subtree-modification-breakpoint