Use $ ("#codeId"). AddClass ("error"); $ ("#codeId"). HTML ("Login cannot be empty"); Add HTML code to the front end effect not coming out?

Source: Internet
Author: User

$ ("#codeId"). AddClass ("error");

$ ("#codeId"). HTML ("Login name cannot be empty");

To determine if the check-in name is empty, the message "Login cannot be blank" is the reason why the effect does not appear:

1. Determine that jquery has been introduced and effective

2. Confirm that the selected ID is correct

3, $ ("#codeId"). HTML ("Login name cannot be empty");

4. Ensure that the "hidden" attribute is removed, these $ ("#nameId"). AddClass ("Error"), $ ("#nameId"). HTML ("Login cannot be empty"); "Color:white" priority is greater than $ ("# NameId "). AddClass (" error "), high so to remove the" Color:white "of $ (" #nameId "). AddClass (" error "), the effect will come out.

JSP page code:

Style $ ("#nameId") to be added through jquery. addclass ("error");

Use $ ("#codeId"). AddClass ("error"); $ ("#codeId"). HTML ("Login cannot be empty"); Add HTML code to the front end effect not coming out?

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.