How to debug code run when hover HTML element

Problem: We have a javascript code run when hover a element. How we debug this code in browser?

Solution: Use debugger; in block code we want to debug.


function codeRunWhenHover() {
    // your code here

Or way what don't modify source code

// Auto enable debug mode after 3s
setTimeout(() => debugger, 3000)

No Comments Yet