undefinedfix
Sign in

Can JavaScript code trigger mouse over event?

rven edited in Tue, 20 Apr 2021

Can JavaScript code trigger mouse over event?

For example: an element El wants to focus it. We can use it el.focus In this way, we can get the focus. To click on an element el. We can use it el.click (), so the sub El will be clicked, so I want to ask, is there any JavaScript code that can be used to make EL elements hover, just like the mandatory element in chrome developer tools: how to realize the hover state?

clipboard.png

6 Replies
spawn1978
commented on Tue, 20 Apr 2021

If you use jQuery,. Mouseover (), if you don't use it, use the. DispatchEvent method. If you use IE, use. Fireevent

ruhix
commented on Tue, 20 Apr 2021

OnMouseOver is mouse over

purplemouse
commented on Tue, 20 Apr 2021

The same instructions as jQuery, mouseover and mouseout

fjadskl
commented on Wed, 21 Apr 2021

You can use trigger to trigger. As for how to use trigger, you can check the usage of trigger on the Internet. It allows you to customize some time, such as el.helloWorld () at this time, after a series of judgments, if the conditions are met, trigger can be used

Amer
commented on Wed, 21 Apr 2021

mouseover / mouseenter

Nioooooo
commented on Wed, 21 Apr 2021

The mouseenter event is the mouse over event.

lock This question has been locked and the reply function has been disabled.