jquery Chapter1. Slice () reduces the set of matching elements to a subset of the specified exponential rangeExample:$ (' li ')
.slice(2, 4)
. css (' background-color ', ' red ');
JS Chapter1. The replace () method is used to replace other characters with some characters in a string, or to replace a substring that matches a regular expression 2, splice () method to/from an array to add/remove items, and then return the deleted item.Example: Arr.splice (2,0, "William") 3. The split () method is used to split a string into a string array 4, substr () method to extract a string from the
StartThe specified number of characters at the beginning of the subscript.Example: document.write (
str.substr(3)
)5. The substring () method is used to extract the character of a string intermediary between two specified subscripts 6, trim () the
trim()
method returns the string stripped of whitespace from both ends.
trim()
Does not affect the value of the string itself. Example:var orig = ' foo '; Console.log (Orig.trim ()); ' Foo '7. Array function join: The elements in the stitching array are a string reverse: The order of the array elements is reversed sort: The array elements are reordered 8, the Math function math object, including the properties and Method properties: Math.PI, MATH.E (natural logarithm), math.lin2 ( 2 logarithm), math.log2e (logarithm of E, base 2) function: ABS: Returns the absolute value of a numberACOs function: Returns the inverse cosine of a number with a result of 0~π radians (radians).
ASIN function: Returns the inverse sine of a number, resulting in-Π/2~Π/2 radians.
Atan function: Returns the inverse tangent of a number with the result of-Π/2~Π/2 radians.
atan2 function: Returns the polar coordinate angle value of a coordinate.
cos function: Returns the cosine of a number with the result of -1~1.
Exp function: Returns the value of the exponent of E (natural logarithm). log function: A natural logarithmic function that returns the natural logarithm (e) value of a numberPOW function: Returns the value of a numbersin function: Returns the sine of a number with the result of -1~1.
sqrt function: Returns the square root value of a number.
Tan function: Returns the tangent value of a number
Ceil: Returns the smallest integer value of a number (greater than or equal to) floor: Returns the maximum integer value of a number (less than or equal to) round: Returns the rounded value of a number, the type is an integer max: Returns the maximum value of two digits min : Returns the minimum value of two digits random: Returns the number of a 0~1
9, String function Charat: Returns a character 10 specified in the string, the mouse position of the event. Xevent.y11, form cookiedocument.cookie12, auto Refresh 13, transparent backgroundallowtransparency>14. Forbidden to save
15. Prohibit Selection
16. No pasting
1, alert content plus \ n implementation of line 2, pass parameters as variables, sometimes need to escape
Document.queryselectorall (' div ')
Enclose the single quotation mark in double quotation marks, inside the double quotes escaped "onclick= ' Wdatepicker (\" xxx \ ") '" or double quotation marks in single quotation marks, inside the single quotes escaped ' onclick= "wdatepicker (\ ' xx\ ')" ‘
JS and jquery Sporadic summary