Detect element content changes with jQuery

后端 未结 15 2527
余生分开走
余生分开走 2020-11-22 04:19

change() function works and detects changes on form elements, but is there a way of detecting when a DOM element\'s content was changed?

This does not w

15条回答
  •  难免孤独
    2020-11-22 04:58

    It's not strictly a jQuery answer - but useful to mention for debugging.

    In Firebug you can right-click on an element in the DOM tree and set up 'Break on Attribute Change':

    Element right-click in Firebug with Break on Attribute Change highlighted

    When an attribute is changed in a script, the debug window will appear and you can track down what it going on. There is also an option for element insertion and element removal below (unhelpfully obscured by the popup in the screengrab).

提交回复
热议问题