I noticed that everything is ok in Chrome, but the FP does not add an additional element, writes that it does not see the event, validation in HTML5 rescues me, but it’s generally interesting how to beat it

` let checkMaxWidth = function(elem = addAdditionalContainer){ let inputForm = event.target; console.log(inputForm.parentNode); inputForm.parentNode.appendChild(addAdditionalContainer); event.preventDefault; return false; };` 

Full project code

Debugger

  • 2
    Possible duplicate question: event.preventDefault () does not work; in FF - Darth
  • writes that he doesn’t see events and cannot be circumvented; target element is needed - Natalia Aga
  • why not just pass this event to the checkMaxWidth call? - Grundy
  • What should the attached picture show? - Grundy
  • in a call and not in the declaration? - Natalia Aga

1 answer 1

These are the features of IE8- .

Instead of event.target in IE8- , event.srcElement used event.srcElement

If you write a handler that will support both IE8- and modern browsers, you can start it like this:

 elem.onclick = function(event) { event = event || window.event; var target = event.target || event.srcElement; // ... теперь у нас есть объект события и target ... } 
  • You apparently can not read ... - Vadim Pedchenko