VOOZH about

URL: https://www.geeksforgeeks.org/reactjs/react-oninput-event/

⇱ React onInput Event - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

React onInput Event

Last Updated : 23 Jul, 2025

React onInput is an event handler that triggers then there is any change in the input field. It is fired immediately when the user is changing input. It is one of the form events that updates when the input field is modified.

It is similar to the HTML DOM oninput event but uses the camelCase convention in React.

Syntax:

<input onInput={handleChange} >

Parameter:

  • handleChange: It is a function call that includes the code to be executed when an event triggers

Return type:

  • event: It is an event object containing information about the event like target element and values

Example 1: This example demonstrates the use of the onInput event handler to update the states in React.

Output:

👁 Peek-2023-11-28-15-41

Example 2: This example demonstrate the use of the onInput event handler in select input.

Output:

👁 Peek-2023-11-28-15-35



Comment
Article Tags: