How to use the input event to listen to the input on the mobile side? The following editor will give you a comprehensive introduction. Hope it will be helpful to everyone. Let's take a look with the editor
Today I encountered a new demand. The manager asked the comment function to limit the number of words, just like Weibo, limiting the maximum input of 150 words. Here we need to remind users in real time how many more words can be entered.
At the beginning, the thought of listening to the keyup event and then calculating the number of words entered by the user, but some keys (such as the delete key) do not trigger the event.
Later, I checked html5 and added an input event. This event is similar to the change event, but the change event is triggered when the element loses focus, and the input event will be triggered when the element value changes.
At present, except for IE89, other browsers support are still good, so you can use it with confidence on the mobile terminal.
The above article how to use the input event to monitor the input on the mobile terminal is all the content I share with you. I hope it can give you a reference, and I hope you can support VeVb Wulin.com more.
Original address: http://www.cnblogs.com/wodertian/p/5391113.html