Город МОСКОВСКИЙ
00:01:25

JavaScript How to check if the Escape button pressed?

Аватар
JS: эксперименты с ума
Просмотры:
28
Дата загрузки:
29.11.2023 17:16
Длительность:
00:01:25
Категория:
Обучение

Описание

There is some site.
And there is an action that must be triggered if the Escape button has been pressed.
We need the document object and the addEventListener method to subscribe to the keyup event.
In the event handler we check the key.
If the key is Escape we call the action.
That’s all.
Let’s press the Escape button.
The escape button has been pressed.

Рекомендуемые видео