Search...
onInput( )
Adds an event handler that runs when the input element receives input.
Description
A text input receives an input
event when a user changes its input value.
You can retrieve the input element's new value by getting the value
from the
target
property of the Event
passed to the handler you set
using this function.
You can also define an event handler using the Properties and Events panel.
Syntax
function onInput(eventHandler: EventHandler): ElementeventHandler: function EventHandler(event: Event): void
onInput Parameters
NAME
TYPE
DESCRIPTION
eventHandler
The name of the function or the function expression to run when the input element receives input.
EventHandler Parameters
NAME
TYPE
DESCRIPTION
Returns
This function does not return anything.
Return Type:
void
Mixed in from:$w.TextInputMixin
Was this helpful?
Get the new input value
Copy Code
1$w("#myElement").onInput( (event) => {2 let newValue = event.target.value; // "newValue"3} );