Unlike KeyPress, the event is triggered only when the user enters a visual character, and the Keypres event triggers (such as capslock,backspace) by pressing the key.
You can see that the textinput is mainly about characters, and you can get the input characters from the event object's Data property.
Example
<! DOCTYPE html> <ptml> <pead> <title>dom3 event textinput</title> </pead> <body> <input id= "IPT" type= "text"/> <script type= "Text/javascript" > Function addevent (EL,TYPE,FN) {if (El.addev Entlistener) {El.addeventlistener (type, FN, false); }else{el.attachevent (' on ' + type, fn); } var IPT = document.getElementById (' IPT '); Addevent (IPT, ' TextInput ', function (e) {e = e | | window.event; Console.log (E.data); }); </script> </body> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
At present only Ie9,chrome,safari support.