JS input email automatically prompts [like Microsoft Live.cn]

Source: Internet
Author: User

Similarly, this plug-in does not require any html tags. It only requires a corresponding class name in the input box and a class name in the parent level. No other class names are required. Internal HTML code is automatically generated.

The HTML code is as follows:

<Div class = "parentCls"> <input type = "text" class = "inputElem"> </div>

In fact, the above div labels do not need to be added in the input box and the parent element to the above class (User-Defined can also, only when JS Initialization is required, it is OK to pass in the class. By default, the parent class is parentCls. The class in the current input box is inputElem, and the class in the hidden field is hiddenCls, you can directly initialize the input null object during initialization !). Because there may be multiple input boxes on the page, a parent class is required to distinguish the input box. Of course, a hidden Domain value should be provided to the development background.

The configuration item contains a mailbox array parameter mailArr: ["@ qq.com", "@ qq2.com", "@ gmail.com", "@ 126.com"," @ 163.com", "@ hotmail.com ", "@ live.com", "@ sohu.com", "@ sina.com", "@ keleyi.com"]. It is to tell us that there are so many default mailboxes, No matter what drop-down box I enter, there are so many mailbox prompts during initialization, when I get a certain item, I will give a prompt to get a specific item. Of course, because you need to change the mailbox parameter, you can configure it as needed during initialization.

The following functions are implemented:

1. You can move the keyboard down or press Enter.

2. When you click document, the drop-down box is hidden except the current input box. When the input is followed, automatic matching is implemented.

JS input box email prompt-ke leyi JS input box email prompt · ke leyi original


CSS

{:;:;}{:;}{:;:;:;:;}{:;}{:;:;:;:;}{:;:;}{:;}{:;}   

 

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.