element.oninvalid = handlerFunction; var handlerFunction = element.oninvalid;
handlerFunction should be either
See the DOM event handlers page for information on working with
invalid event is fired when a submittable element has been checked and doesn't satisfy its constraints. The validity of submittable elements is checked before submitting their owner form, or after the
checkValidity() of the element or its owner form is called.
invalid event documentation for more information about the event.
|HTML Living Standard
The definition of 'oninvalid' in that specification.