The input event is used to listen to the input and input events of the mobile terminal.
Today, I encountered a new requirement. The manager asked the comment function to limit the number of words, just like Weibo, to enter a maximum of 150 words. Here I need to remind users of the number of words they can enter in real time.
At the beginning, I thought of listening to the keyup event and calculating the number of words entered by the user. However, some buttons (such as the delete key) do not trigger the event.
Later, I checked and added a new html5InputThis event is similar to the change event, but the change event is triggered only when the element loses focus, and the input event is triggered when the element value changes.
At present, apart from IE89, other browsers support good services and can be safely used on mobile terminals.