js trigger mouseover 1

js trigger mouseover

​document.getElementById('xyz').dispatchEvent(new MouseEvent('mouseover', { 'bubbles': true }));

Here is what the above code is Doing:
1. We are creating a new MouseEvent object.
2. We are passing the event type as the first argument.
3. We are passing the event options as the second argument.
4. We are dispatching the event on the element.

Similar Posts