The problem is that I do not know js well and can not figure out how to realize my idea. There is a form that after a successful bid creates a class of type itself - formsuccess. I want to hang the function on the submit button to call the function and check if the formsucces class appeared, if yes, then call the goal function. ga ('send', 'event', 'form', 'succes'); return true;
I do not understand how to call a function simply when searching for a class.
I can not find a similar situation and material how to properly create and call such a function. Well, it is desirable to make this launch a function at intervals so that the form has time to get status.