How does native js style the hover state of dom elements?

how do I style the hover state of dom elements using native js?
requirements are as follows:
1. No outreach css table settings are used, and there is no className. For example, < del > abc:hover {} < / del >,
2, do not use the onmouseover,onmouseout event to change the style.
is there any way to achieve this?

Mar.19,2021

document.styleSheets learn


do not use the onmouseover,onmouseout event to change the style.

what is hover? hover is onmouseover,. If you are not allowed to use onmouseover, how does the browser know that you are hover?


I am using

window.addEventListener('onmouseover', function(){})

to monitor


can be implemented, https://www.jianshu.com/p/009.

Menu