Home > Web Front-end > JS Tutorial > In-depth understanding of the difference between JQuery keyUp and keyDown_jquery

In-depth understanding of the difference between JQuery keyUp and keyDown_jquery

WBOY
Release: 2016-05-16 17:09:32
Original
1152 people have browsed it

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.

Copy code The code is as follows:







Enter your name:

The input field changes color when keydown and keyup events occur. Please try typing there.





As we all know, jquery encapsulates many event interaction methods, and the problems mentioned here are also in native js some.

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.

Copy code The code is as follows:



Untitled page




몇 가지 문자를 자유롭게 입력하세요.

위 상자에 텍스트를 입력하면 아래 div에 키 번호가 표시됩니다.



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template