The input event is used to listen to the input and input events of the mobile terminal.

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.