How can I Observe the contents of an 'a' tag - jquery

后端 未结 4 948
轮回少年
轮回少年 2021-02-07 18:05
4条回答
  •  不知归路
    2021-02-07 18:46

    You could make use of the DOMSubtreeModified event. That event fires at an element when it's contents change.

    $('a').bind('DOMSubtreeModified', function() {
        // contents changed   
    });
    

    Note: this event does not fire in Opera and older versions of IE (it works in IE9 though).

    Live demo: http://jsfiddle.net/simevidas/pLvgM/

提交回复
热议问题