Search code examples
javascripthtmlinputevent

What are the valid strings for the typeArg argument of the InputEvent constructor?


From MDN InputEvent() docs:

event = new InputEvent(typeArg, inputEventInit);

typeArg Is a DOMString representing the name of the event.

What are the valid "names?" I can't find any resources indicating this. I want to replicate a typing event for my tests.


Solution

  • This is listed in Section 5.2 of the Input Events Level 2 Specification and are input and beforeInput. This is also listed in Section 4.5.3 of the UI Events Specification.