Invoke Escape key press event by jquery

后端 未结 2 611
闹比i
闹比i 2020-12-09 04:40

I want to make my question clear. Please dont confuse it with determining the key press. I dont want the user to press any key. On the contrary, I want to run a script which

2条回答
  •  难免孤独
    2020-12-09 05:21

    For security reasons, some browsers (not sure if all), prevent you from firing keydown-events. Please refer to this article for more info.

    A quote from the article:

    Safari/Chrome makes the keyCode and charCode properties read-only, so it is not possible to simulate specific keys when manually firing events.

提交回复
热议问题