I\'m trying to simulate a keyboard event in Safari using JavaScript.
I have tried this:
var event = document.createEvent(\"KeyboardEvent\"); event.in
This is due to a bug in Webkit.
You can work around the Webkit bug using createEvent('Event') rather than createEvent('KeyboardEvent'), and then assigning the keyCode property. See this answer and this example.
createEvent('Event')
createEvent('KeyboardEvent')
keyCode