oninput and onchange of DOM oninput when entering content, it is called continuously, and the value can be taken continuously through element.value . Losing focus and getting focus will not be called. onchange is not called during input, but only when the value when losing focus and losing focus is inconsistent with value when gaining focus (the input changes). if you need to detect whether the contents of one of the user's input boxes have changed, onchange can handle this situation very well. <body> <input type="text" id="myInput" oninput="myinput()" /> <input type="text" id="change" onchange="mychange()" /> </body> <script> function myinput() { var x = document.getElementById("myInput").value; console.info("input", x); } function mychange() { var x = document.getElementById("change").value; console.info("change", x); } </script> onInput and onChange in React There is not much difference between onInput of React and onChange . It is triggered when the user continues to type, not when the user loses access or focus. to get focus related events, you need to use onFocus and onBlur . If you need to check whether the content entered by the user has changed, you need to compare the values manually, which is not as convenient as the native onChange . export default function InputChange() { function input(e) { console.info("input", e.target.value); } function change(e) { console.info("change", e.target.value); } return ( <div style={{ display: "flex", flexDirection: "column" }}> <input onFocus onBlur onInput={input}></input> <input onChange={change}></input> </div> ); } check the TypeScript type of the corresponding parameter: <input onInput={(evt: React.FormEvent<HTMLInputElement>) => {}}></input> <input onChange={(evt: React.ChangeEvent<HTMLInputElement>) => {}}></input> The argument to onInput is React.FormEvent , while onChange is React.ChangeEvent ,…