How do I monitor the DOM for changes?

前端 未结 4 1124
傲寒
傲寒 2020-11-28 13:53

Is there a way - using jQuery or otherwise - to monitor the DOM for insertions, deletions, updates to styles, etc?

4条回答
  •  盖世英雄少女心
    2020-11-28 14:15

    This is only for debugging purposes:

    Firebug currently allows setting breakpoints on html nodes.

    You have to open the html inspector, right click on a node and you have the following options:

    • Interrupt on attribute change
    • Interrupt on child add/remove
    • Interrupt on remove

    Once you reach the breakpoint you can also browse the call stack.

    Google Chrome has a similar feature too.

提交回复
热议问题