Simulate left and right arrow key event with javascript
问题 I'm using the slide.html5rocks.com framework and I'm trying to use to img tags inside of a tag links and I can't get the JavaScript onclick to simulate the left and right key events to change slides 回答1: You're looking for something that will dispatch an event. Here's something that should work: function fireKey(el) { //Set key to corresponding code. This one is set to the left arrow key. var key = 37; if(document.createEventObject) { var eventObj = document.createEventObject(); eventObj