4 ms·
You can use e.preventDefault() at the top of your event listener to prevent the keys from affecting the page. The page would move even from these links if your
by path411 14y ago
You can use e.preventDefault() at the top of your event listener to prevent the keys from affecting the page.
The page would move even from these links if your page was long enough to have a scroll.
(You can see it by shrinking the window all the way down until it gets a scroll)