js introduction, notes, events

1. introduction embodiment
1. <Script>
Alert (123)
var X, Y; # function variables
X = 12 is;
Y = 55
Alert (X);
the console.log (Y);
</ Script>
2. <Script the src = "file name .js"> </ Script>
2. the method of release co //
3.If method: if (a <b) { }: in brackets
4. S function function () {
var of He = "hello" ; # variable
docment.write ( "man") # control the HTML
}
the console.log (S ());
5. The data type of
the basic data types: number, null, string, undefined , bolean
reference data types: objcet

6. Event HTML

 

 

7.字符串方法
length返回字符串的长度
indexOf()查找字符串的字符串
lastIndexOf()返回指定文本字符串最后一次出现的索引
indexOx()同上
search()查找字符串的位置
提取部分字符串
slice(开始,结束)
substring(开始,结束)
substr(开始,结束)
toUpperCase()字母小写变大写
toLowerCase()字母大写变小写
concat()连接字符串

Guess you like

Origin www.cnblogs.com/cui00/p/12347728.html