I would like to make a script that, when the text of a certain paragraph change, start a certain function, I tried the follow but i don't think the method change() works for a paragraph
$("#myParagraph").change(function(){......})
I would like to make a script that, when the text of a certain paragraph change, start a certain function, I tried the follow but i don't think the method change() works for a paragraph
$("#myParagraph").change(function(){......})
You would wrap that tag or "paragraph" in a container, and bind that container to a event possibly. You could also look into using the length of the "text" property. During this triggered event, check that the state is different. I can write an example if you need one. One place to look at is the
//global variable. Store in hidden field if you would like.
var currentVal = $('element').text();
$('element').bind("DOMSubtreeModified",function(){
var newVal = $(element).text();
if(currentVal != newVal)
{
//call function here.
}
});
This is basic and very simple, but to give you the idea.