"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>
document.forms.addEventListener ('invalid', function (ev)
Do I understand something incorrectly or browsers ignore HTML in aforementioned part?
(By the way, with that example document we can see that console.log () in IE11 and Edge prints closing 'input' tag.)