I need to make some JQuery execute when the page/document has changed - in this case, when a div with a specific CSS class is displayed.
I have the following JQuery
Change is only for input, textarea or select elements. Instead you need to bind a function to the DOMSubtreeModified mutation event:
$(document).bind('DOMSubtreeModified', function () {
if ($('.validation_errors').length) {
alert("test");
}
});
EDIT: If your target browsers support it, you should use a MutationObserver instead.