"When a form is submitted, invalid events are fired at each form control that is invalid, and then at the form element itself."
But browsers actually fire 'invalid' event only at the form control, not at the form itself. Test document:
Code: Select all
<!doctype html><html lang="en"><meta charset="utf-8"><title>title</title>
<form><input name="name" required><input type="submit"></form>
<script>
document.forms[0].addEventListener ('invalid', function (ev)
{
console.log (ev.target);
}, true);
</script>
(By the way, with that example document we can see that console.log () in IE11 and Edge prints closing 'input' tag.)