Search...
onKeyRelease( )
Adds an event handler that runs when the key is released within an input.
Description
You can also define an event handler using the Properties and Events panel. This will automatically add the required code for the selected element and event.
Notes:
Some browsers do not issue a key release event for certain keys, such as arrow keys or the shift key.
When you retrieve the
value
from thetarget
property of aKeyboardEvent
, you get the value of the target element before the key was released.
Syntax
function onKeyRelease(handler: KeyboardEventHandler): Elementhandler: function KeyboardEventHandler(event: KeyboardEvent): void
onKeyRelease Parameters
NAME
TYPE
DESCRIPTION
handler
The name of the function or the function expression to run when the element is clicked.
KeyboardEventHandler Parameters
NAME
TYPE
DESCRIPTION
Returns
This function does not return anything.
Return Type:
void
Was this helpful?
Print key released and event type
Copy Code
1$w('#myElement').onKeyRelease((event) => {2 console.log(event.key); // Enter3 console.log(event.type); // keyRelease4});