oninput: event occurs when the text content of an element is changed through the user interface
onchange: occurs when the selection, the checked state or the contents of an element have changed. In some cases, it only occurs when the element loses the focus. The onchange attribute can be used with <input>
, <select>
, and <textarea>
Select : i changed Bob to Alice .
Input: i input 123.
code source : https://github.com/xiansheng123/myJavascript/blob/master/src/Html_Onchange_Oninput.html