How to handle change text of span

后端 未结 3 405
清酒与你
清酒与你 2021-01-03 17:56

I\'m using jQuery and I want to show some calculation in a span (called span1) and I want when text of span1 changed do some calculation on it\'s v

3条回答
  •  借酒劲吻你
    2021-01-03 18:38

    Found the solution here

    Lets say you have span1 as my text
    text change events can be captured with:

    $(document).ready(function(){
        $("#span1").on('DOMSubtreeModified',function(){
             // text change handler
         });
    
     });
     
    

提交回复
热议问题