I am looking for a way to trigger some functionality whenever a user hovers an element and while hovering it, I want the user to press a key.
Simply stacking multiple event handlers won't do the trick as you can see below.
allFocusableElements.forEach((link) => {
link.addEventListener('mouseover', () => {
link.addEventListener('keyup', (e) => {
if (e.keyCode === 70) {
link.focus();
}
});
});
});
Any help is greatly appreciated.