This article mainly introduces the common javascript data verification plug-ins. For more information, see native Javascript phone number verification, email verification, and ID card verification. Input the string to be verified during use. if true is returned, false is returned.
Usage:
Document. getElementById ("btnPhone"). onclick = function () {alert (ValidationHandler. IsPhone (document. getElementById ("phoneInput"). value) = true? "Legal": "illegal")}; document. getElementById ("btnEmail "). onclick = function () {alert (ValidationHandler. isEmail (document. getElementById ("emailInput "). value) = true? "Legal": "illegal")}; document. getElementById ("btnIdCard "). onclick = function () {alert (ValidationHandler. isIDCard (document. getElementById ("idCardInput "). value) = true? "Legal": "illegal ")};
The above section describes all the content of the common javascript data verification plug-ins.