Reputation: 99
I have <span id="row">text</span>
, text inside is changing by another function.
Can I make event 'on this text change'? like
$('#row').text().change(function(){ /some action... });
Upvotes: 1
Views: 2451
Reputation: 4999
Suggest use on function: $("#row").on("change", function() { ... });
Upvotes: 0
Reputation: 1946
You can store the old HTML of the div in a variable. Also,use an setInterval of maybe 1 second,to check if the old content is same as current. When this isn't true do something.
Upvotes: 0
Reputation: 11808
You can use directly like following:
$('#row').change(function(){
//some action
});
Upvotes: 1