How can I add a JavaScript keyboard shortcut to an existing JavaScript Function?
- by Chris
Here is my code:
function pauseSound() {
var pauseSound=document.getElementById("backgroundMusic");
pauseSound.pause();
}
I would like to add a keyboard shortcut to this code, how can I do this so that the function can also be executed when a button is clicked too?