JS realizes the _javascript technique of lightweight hint plugin based on regular expression

Source: Internet
Author: User

The example of this article is based on the regular expression of lightweight hint plug-ins, shared for everyone to reference. Specifically as follows:
This is a JavaScript implementation based on the regular expression of lightweight hint plug-in, the plug-in is based on regular expressions for text box detection, the universality is very strong, we can use in the example.
Run Effects chart:-------------------View Effects-------------------

Tip: If you are not running properly in your browser, you can try switching browsing mode.
Key code:

    $ (document). Ready (function () {
      $ ("#message"). Inputnotes (
       {
         sexwarning: {pattern
           :/(^|\s) pornography (\s|$) /ig,
           type: ' Warning ',
           text: ' Do not type ' sex '! '
         },
         numbersnote: {pattern
           :/[0-9]/,
           type: ' Note ',
           text: ' does not type numbers! '
         }
       }
      )
    ;

The code for everyone to share is as follows

<! DOCTYPE html>  

The above is for you to share based on the regular expression of lightweight hint plug-ins, I hope you can enjoy, and apply to practice.

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.