0

I needed to trigger a keyup event manually. I could only find implementations that involved jQuery. Is there any way to do it with plain JavaScript?

edddd
  • 433
  • 3
  • 17

2 Answers2

2
input.dispatchEvent(new KeyboardEvent('keyup', {'key':'y'}));

Dispatch Event

uiTeam324
  • 1,215
  • 15
  • 34
0

You can see this > https://www.cnblogs.com/xiaozhuyuan/p/8296827.html you can find the answer for your problem

张泽明
  • 11
  • 1