a function
1. String functions
S.tolowercase ();---Variable lowercase
S.touppercase ();---Variable capitalization
S.SUBSTR (2, 8);--intercept starts at index 2, intercepts 8 character lengths
S.split ();--Specifies the character split, returning an array. Put a character in parentheses, divide s by this character
s.length;--length
S.indexof (); --The first occurrence in the string, looking for an index, no return-1.
S.lastindextof (); --Find the first matching index from the back.
2. Time-Date function
var d = Now Date (); --current time, access to the user's computer system time (prone to problems)
var d = Now Date (1999,3,2)-Defines the time, April 2, 1999.
--Define the month minus one.
Get
D.getfullyeat (); --Take the year
D.getmonth ();--Take the month, which is 1 less than the actual month.
D.getdate (); --Take the day
D.getday (); --Take the day of the week
D.gethours (); --Take hours
D.getminutes (); --Take minutes
D.getseconds (); --Take seconds
Set up
D.setfullyear (); --Set year
D.setmonth ();---set the month in the setting is time to note plus 1.
...........
3. Mathematical functions
Math.ceil (); --Take the upper limit
Math.floor (); --Take the lower limit
Math.Round (); --Rounding
Math.random (); --random number, between 0--1
var v = math.random ();
Math.ceil (V*10); --Take 1--10 random number
A. Match (b)--determine if the match
--String A, B to match, if not match returns null
--just determine if the content matches, not the data type.
--"= = =" Three equal signs indicate identity, content type, etc. are equal.
JS DOM Manipulation function event