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

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -