Home  >  Article  >  Web Front-end  >  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

WBOY
WBOYOriginal
2016-05-16 17:37:321420browse

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:

, ,
, , , , , ,