Simulate hover using JavaScript events
问题 Is it possible to simulate hover using JavaScript Events? I tried injecting mouseover event on the target element but no luck. For example, if there is a link that has a hover selector, is it possible to "hover" over it using JavaScript Events? Basically, I want to trigger CSS hover. You can assume I can't use jQuery. 回答1: The jQuery hover event is just using mouseenter and mouseleave events. Here is the source of jQuery's hover: function (fnOver, fnOut) { return this.mouseenter(fnOver)