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?

2
  • 3
    Yes, google "diapatch event mdn". Commented Sep 16, 2020 at 7:42
  • @TomášZato-ReinstateMonica thanks Commented Sep 16, 2020 at 7:43

2 Answers 2

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

Dispatch Event

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.