One, form verification:
1. Non-null verification (go blank)
2. Contrast verification: compare with a value
3. Scope Validation: Judging by a range
4. Fixed format test: email, phone number, ID number, postal code, credit card number
5. Other Verification:
Regular expressions: Using symbols to describe writing rules
Grammatical form: var a =/the contents of the regular expression;
^: Match opening/^love$/very love Lovelove
$: Match End
\d: An arbitrary number/^\d\d\d\d\d\d$/
\w: An arbitrary number or letter
{n}: Put the expression on the left, repeat N-Times/^\d{6}$/
{M,n}: Put the expression on the left, repeat at least m times, at most n times
{m,}: The expression on the left is repeated at least M-times, at most
+: The left expression appears at least once, at most, equal to {1,}
*: Left expression, at least 0 times, at most, equivalent to {0,}
?: Left expression, at least 0 times, up to 1 times, equivalent to {0,1}
[A,c,d]; only one of the contents in square brackets can be taken
[A-z] or [a-z] or [0-9]: Take one of the ranges
|: OR
(): Priority
\: Escaped
((\ (\d{3,4}\)) | (\d{3,4}[-]))? \d{7,8}
(0533) 3434567
Second, date time operation
var d = new Date (); Current time
var d = new Date (1999,3,2); 1999-4-2
getFullYear ()
GetMonth ()
GetDate ()
GetDay ()
GetHours ()
Getminutes ()
Getseconds ()
Third, mathematical function operation
Math.ceil ();
Math.floor ();
Math.sqrt ();
Math.Round ();
Math.random ();
Iv. Events
Event three elements: Event source, event data, event handler
Event bubbling: When an element is nested at a time, by default, an inner element fires an event, and the corresponding event of the outer element is then triggered in turn.
onclick--Click Trigger
ondblclick--Double-click Trigger
onmouseover--Mouse Move Up trigger
onmouseout--triggers when the mouse leaves
onmousemove--Mouse on the top move less
Trigger when onblur--loses focus
Trigger when onfocus--gets focus
onchange--after the content has changed, trigger
OnKeyDown
onkeyup--trigger when the button is lifted.
onkeypress
JavaScript script code (c) 20140926