Jquery manual trigger event

Source: Internet
Author: User

Sometimes you may need to useCodeEvents that trigger a button, text box, or other controls on the webpage are commonly used during logon. The logon interface usually has three text boxes: User Name, password, and verification code, there is also a login button. In many cases, we want to interact with the background to check whether the user name exists, whether the password is correct, and whether the verification code is correct when a text box loses focus, however, there is another possibility: When you enter one of the three, you can directly click the logon button without losing the focus, in this case, you need to manually call the loss of focus event in the text box in the login button to determine whether all events are passed and then log on successfully.

Paste the Code directly:

If you want to trigger a blur event in the text box whose ID is input, you can write it as follows:

$ ('# Input ').Trigger("Blur ");

Similarly, if you want to call the click event of input, you can write as follows:

$ ('# Input'). Trigger ("click ");

 

And so on...

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.