Bom
# BOM
# 窗口
Window.prompt()
1
# 浏览器导航
localtion.href
跳转
localtion.search
?xxxxx
localtion.hash
#xxxxx
// 导航
history.goback()
history.forward()
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 存储
localstore.setitem()
sessiStore.setItem()
1
2
3
2
3
# js 标准库
Math.cell()
Math.floor()
Math.rount()
parseInt()
random(0..1)
pow()
min()
max()
sqrt()
getRamdom(a,b)
let p =[];
p.splice()
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
# DOM
document.querySelector("css 选择器")
document.getElementById()
document.getElementByTag()
document.getElementByClass()
document.getElementsByTagName("title")[0].getAttributeNode("lang");
x.parentNode
x.childNodes
x.firstChild
x.lastChild
x.nextSibling
x.previousSibling
document.createElement('div')
document.body.appendChild(clild)
obj.getAttribute("")
obj.setAttribute("")
obj.innerText
obj.innerHTML
obj.className=""
obj.classList.add("")
obj.classList.toggle("")// 添加或删除
obj.nodeName // x 的名称
obj.nodeValue //x 的值
obj.parentNode // x 的父节点
obj.childNodes // x 的子节点
obj.attributes // x 的属性节点
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# 监听
obj.addEventListenr("eventname",fn(){
// click
// hover
// touchstart
// touchmove
// touchend
// change // inputbox
})
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
# 外部加载
let p = document.DOMParser();
p.parseFromString(text,"text/xml");
1
2
2
编辑 (opens new window)
上次更新: 2024/04/16, 00:35:21