Home Web Front-end JS Tutorial The onkeydown event solves the need to directly submit data by pressing the Enter key_javascript skills

The onkeydown event solves the need to directly submit data by pressing the Enter key_javascript skills

May 16, 2016 pm 05:37 PM
Enter key submit

The login page needs to capture the user's need to press Enter to submit automatically:
Add an onkeydown event in the body to jump to the javascript before submitting the form.

Find the document as follows
The onkeydown event occurs when the user presses a keyboard key.
Syntax: onkeydown="SomeJavaScriptCode"

HTML tags that support this event;

Copy code The code is as follows:

, ,
, , , , , ,