1
A div receives a new paragraph each click, jQuery checks if there has been a change in the DOM, the event is called normally but is returning the message:
UNDEFINED. The check does not work with .size() and .lenght of jQuery v3.3.1.
HTML:
<div class='mensagem-list'></div>
And the jQuery:
<script>
$("body").on('DOMSubtreeModified', '.mensagem-list', function() {
window.alert( $('.p-list').size );
});
</script>
On the console every click on the button, the date is getting like this:
<div class='mensagem-list'>
<p class='p-list'>[mensagem exibida]</p>
<p class='p-list'>[mensagem exibida]</p>
</div>
Thank you beast!!!
– ElvisP
For nothing Elisha.
– LeAndrade