THE WORLD'S LARGEST WEB DEVELOPER SITE

InputEvent data Property

❮ DOM Events ❮ InputEvent

Example

Return the input data from a text field:

function myFunction(event) {
  var x = event.data;
}
Try it Yourself »

Definition and Usage

The data property returns the character that was inserted with the event.

Note: This property is read-only.


Browser Support

Property
data 60 Not supported Not supported Yes Yes

Syntax

event.data

Technical Details

Return Value: A String, indicating which character that was inserted

❮ DOM Events ❮ InputEvent