How can I generate a keypress event in Safari with Javascript?

前端 未结 4 1665
离开以前
离开以前 2021-01-01 00:28

How can I programmatically generate keypress events from Javascript code running in Safari? It looks like WebKit is using the DOM level 3 model for creating keyboard events

4条回答
  •  天命终不由人
    2021-01-01 01:13

    http://docs.jquery.com/Events/keypress#fn

    In other words, you attach a keypress event to some element. Using an element with the ID of "someid", for example:

    
    
    

提交回复
热议问题