2808 explained code solutions for 75 technologies


chrome-extensionHow to simulate mouse over event on a page


document.querySelector('div')
.dispatchEvent( new MouseEvent('mouseover', {'bubbles': true})) ;ctrl + c
'div'

query selector for an element to simulate mouse over on

dispatchEvent

triggers specified event

MouseEvent

creates specified mouse event

mouseover

we need to simulate mouse over

{'bubbles': true}

event will bubble up the hierarchy of the elements (standard mouseover behaviour)