Is it possible to make a focusable div act like a button, triggering an action on both mouse click and enter key press using just one event listener?
document.getElementById("myId").addEventListener("click", function() {
console.log("click");
});
document.getElementById("myId").addEventListener("keyup", function(e) {
if(e.keyCode === 13) {
console.log("click");
}
});