Different between Change and input event in JavaScript

Xuda Lu
1 min readNov 6, 2019

--

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

--

--

Xuda Lu
Xuda Lu

No responses yet