keyCode keys f11 = 122
if this code starts the function by pressing (!) a key on the keyboard (cut from another file of mine, now there is a need to do the opposite):
document.addEventListener('keyup', function(c){ //esc if((popup.classList == 'modal-image is-fade') && (c.keyCode == 27)){ closeModal.click(); } //right if((popup.classList == 'modal-image is-fade') && (c.keyCode == 39)){ next.click(); } //left if((popup.classList == 'modal-image is-fade') && (c.keyCode == 37)){ prev.click(); } }); How to write a function that will simulate a click on the f11(122) button? I clicked on the block, the full-screen mode opened, that is, the f11 button was pressed