Definition and usage
The complete key press process is divided into two parts: 1. The key is pressed; 2. The key is released.
When the button is pressed, the keydown event occurs.
The keydown() method triggers the keydown event, or specifies a function to run when the keydown event occurs.
The input field changes color when keydown and keyup events occur. Please try typing there.
Keyup is triggered when the user lifts the key. It is the last stage of the entire key pressing process, so it has its specific use. It is very useful in the process of typing on the left and simultaneous display on the right. . A typical example is the application of email editing preview.
몇 가지 문자를 자유롭게 입력하세요.
위 상자에 텍스트를 입력하면 아래 div에 키 번호가 표시됩니다.