Check out example codes for "js html textbox on change". It will help you in understanding the concepts better.

Code Example 1

const handleChange = (event) => {
  console.log(event.target.value);
};

...
<input type="text" onChange={handleChange} />

Code Example 2

var element = document.getElementById("myInput");
element.onchange = function() {
  console.log(element.value);
}

Code Example 3

<!-- 
	You can use any of the following:
	onkeydown, onkeyup or onchange
 -->

<input type="text" onkeydown="keydownFunction()" 
onkeyup="keyupFunction()" onchange="changeFunction()">

Learn ReactJs, React Native from akashmittal.com