JavaScript common form check method!

xiaoxiao2021-03-06  18

/ * Check if the correct email address / *

Function email_check (str) {var seat = / ^ ([A-ZA-Z0-9 _-]) @ ([A-ZA-Z0-9_-]) (/. [A-ZA-Z0-9_- ]) /; If (! Bath.test (str)) Return False; Else Return True;

}

Reconstructing a character function TRIM () Delete the function before and after the function

Function string.prototype.trim () {Return this.Replace (/ ^ / s * / g, ""). Replace (// s * $ / g, ");}

Function EMPTY_CANT (STR) {IF (Str.trim ()! = "") Return True; Else Return False;}

Let the text box only enter numbers

转载请注明原文地址:https://www.9cbs.com/read-42186.html


New Post(0)