Event Name: | onkeypress |
---|---|
Description: | This event will be triggerd/generated when the user press and release a any keyboard button on the element where onkeypress event is used. Only those elements which receive keyboard focus are supported eg: Hyperlinks, Buttons, Textboxes,etc., |
Example: | Use any element which receives keyboard focus.. Step-2: Now press and release any key on this paragraph to change the documents background color to Red |
Event Name: | onkeydown |
Description: | This event will be triggerd/generated when the user presses (but not releases) any keyboard button on the element where onkeydown event is used. Only those elements which receive keyboard focus are supported eg: Hyperlinks, Buttons, Textboxes,etc., |
Example: | Use any element which receives keyboard focus.. Step-2: Now press (and dont release) any key on this paragraph to change the documents background color to Green |
Event Name: | onkeyup |
Description: | This event will be triggerd/generated when the user releases a pressed any keyboard button on the element where onkeyup event is used. Only those elements which receive keyboard focus are supported eg: Hyperlinks, Buttons, Textboxes,etc., |
Example: | Use any element which receives keyboard focus.. Step-2: Now release a pressed any key on this paragraph to change the documents background color to Blue |
A Complete Example:
Press on me!
Release on me!