javascript - JQuery catch an event on Paragraph change -


i make script that, when text of paragraph change, start function, tried follow don't think method change() works paragraph

$("#myparagraph").change(function(){......}) 

you wrap tag or "paragraph" in container, , bind container event possibly. using length of "text" property. during triggered event, check state different. can write example if need one. 1 place @

//global variable. store in hidden field if like. var currentval = $('element').text();   $('element').bind("domsubtreemodified",function(){   var newval = $(element).text();   if(currentval != newval)   {        //call function here.     } }); 

this basic , simple, give idea.


Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -