automatically press keyboard with jQuery?

前端 未结 6 1920
臣服心动
臣服心动 2021-01-19 04:06

Is it possible with jQuery to automatically simulate a press on a keyboard, f.ex. inside an html input field?

As explanation: If I press the a inside an

6条回答
  •  -上瘾入骨i
    2021-01-19 04:31

    Mimicking a keypress in JavaScript (and therefore jQuery) boils down to inserting the "typed" character where you need it and firing off any relevant handlers (i.e., with trigger).

提交回复
热议问题