check what key is being pressed js code example Example: js when key is pressed Click to copydocument.addEventListener("keypress", function(event) { // do stuff });