Change only for input elements, textarea or select. Instead, you need to bind the function to the DOMSubtreeModified mutation DOMSubtreeModified :
$(document).bind('DOMSubtreeModified', function () { if ($('.validation_errors').length) { alert("test"); } });
EDIT: If your target browsers support it, you should use MutationObserver .
source share