Whenever a user enters an incorrect value into a textbox on my page, an error message is displayed within a div with the class 'validation-errors
'.
I'm looking for a solution to trigger a javascript function (which adds a CSS property to a button) whenever the error div becomes visible. Currently, this function is activated using window.onload
.
Is there a way to automatically run the javascript function if the window changes or when an element is added to the page?