jQuery: How to listen for DOM changes?

前端 未结 4 996
攒了一身酷
攒了一身酷 2020-11-28 11:40

Is it possible and how can I listen for changes through the entire DOM tree with jQuery?

My specific issue: I have a \'tooltip\' function that displays the contents

4条回答
  •  死守一世寂寞
    2020-11-28 11:51

    My best guess is that you want to listen to DOM mutation events. You can do that by DOM mutation event as any normal javascript event such as a mouse click.

    Refer to this : W3 MutationEvent

    Example:

    $("element-root").bind("DOMSubtreeModified", "CustomHandler");
    

提交回复
热议问题