I am trying to use click and keydown together but having a problem by pressing key. Is it possible that if we can join both events in one statement.
HTML
<audio id="Q" src="https://s3.amazonaws.com/freecodecamp/drums/Heater-1.mp3"> </audio>
<div>
<button name="Q">Q</button>
</div>
JavaScript
const queButton = document.querySelector("[name=Q]");
queButton.addEventListener("click", function() {
document.getElementById("Q").play();
});
queButton.addEventListener("keydown", function(e) {
if (e.key == 81) {
document.getElementById("Q").play();
}
});