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
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.