How to Use the input event to listen to the input and input events of Mobile Terminals

Source: Internet
Author: User

How to Use the input event to listen to the input and input events of Mobile Terminals

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.

In this article, how to use the input event to listen to the input on the Mobile End is all the content that I have shared with you. I hope to give you a reference and support for the customer's house.

Address: http://www.cnblogs.com/wodertian/p/5391113.html

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.