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
Post a Comment