Detect paragraph element change with JQuery

后端 未结 7 1964
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-06 17:58

Is it possible to detect if the content of a paragraph has been changed in JQuery ?

I tried the below code.

Text

7条回答
  •  囚心锁ツ
    2020-12-06 18:34

    You can use the code from here http://quiiver.appspot.com/method_observer_for_jquery and use it like

    $('#test').bind('text' // the method's name used to change the text
    , function(){
        alert("Paragraph changed");
    })
    

    DEMO However, it works only for modifications done through jQuery.

提交回复
热议问题