ホームページ >ウェブフロントエンド >jsチュートリアル >Javascript_javascript スキルの最初の概要の概要
1.HTML 内のスクリプトは、3f1c4e4b6b16bbbd69b2ee476dc4f83a タグと 2cacc6d41bbb37262a98f745aa00fbf0 の間に配置する必要があります。
スクリプトは HTML ページの 6b79ebd5c4a650c3c0e0fef68f5fe343to, that is Intercepted after automatic replacement.
Str.toLowerCase(): Convert the string to lowercase
Str.toUpperCase(): Convert the string to uppercase
str.split(): Split the string according to the specified symbol
str.slice(): Same as substring() but more flexible, allowing negative values, similar to Array.slice()
str.concat(): String link, similar to Array.concat, but it is more convenient to use numbers
Str.indexOf(): Retrieve characters and return the position where the character first appears
9.var date=new Date() //Create a date object
Main methods:
Date.get/setDay() //Return/set a day of the week (0~6),
Date.get/setFullYear() // Return/set the year in system time
Date.get/setMonth() // Return/set the month field (0~11) in system time
date.get/setDate() //Return/set a certain day of the month
Date.get/setHours() // Return/set the hour field in the system time
Date.get/setMinutes() // Return/set the minutes field in the system time
Date.get/setSeconds() // Return/set the seconds field in the system time
Date.get/setTime() //Return/Set//Return/Set the minute field in the system time
10.var arr=new Array() //Create an array object
Main attributes: arr.length //Returns the length of the array
Main methods:
pop() //Delete and return the last element of the array, the return value is the deleted element
push() //Add elements to the end of the array and return the length of the array
shift() //Move the first element out of the array, and the return value is the deleted element
unshift() //Insert an element at the head of the array and return the length of the array
slice() //Return a part of the array, the parameter can be a negative value, return the intercepted array
Reverse() //Reverse the order in the array and return the reversed array
sort() //To sort array elements, you need to specify a method
concat() //Array connection, returns the connected array without changing the original array
join() //Join the array elements with the specified characters and return them in string form
splice() //Insert, delete or replace elements of the array,
toString() //Convert the array into a string
11.Math is a native object
Math.abs() //Return the absolute value
Math.ceil() // Round up
Math.floor() // Countryside rounding
Math.round() // Rounding up
Math.randow() // Returns a random number
Math.max() // Return the larger value
Math.min() // Return the smaller value
Math.PI() //Constant PI
Math.pow() // x to the y power
Math.sqrt() // Calculate the square
12. Others
isNaN() // Determine whether it is a numerical value. If not, return true
parseInt() // Forced conversion to integer type
parseFloat() // Forced conversion to floating point value
alert() // Warning
confirm() //Message confirmation box
prompt() //Prompt message box
Document.write() //Write content to the HTML document. If the document content is loaded and written using this method, the entire HTML document will be overwritten
document.getElementById() //Get the object by ID name
document.getElementsTagName() //Get the object through the tag name and return an array object
document.getElementsClassName() //Get the object through the class name and return an array object
The above is the entire content of this article, I hope you all like it.