This commit is contained in:
luyuan 2020-12-22 09:19:13 +08:00
parent 0879393caf
commit d39715f110
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3
2 changed files with 57 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -0,0 +1,57 @@
# DOM
## 节点层次
![JAVASCRIPT高级程序设计_9_DOM_节点层次- Jonathan_C - 博客园](12.dom.assets/1316408-20180226171835400-1011513544.png)
## 节点类型
## Document
> nodeType 9
>
> nodeName '#document'
>
> nodeValue null
>
> parentNode null
>
> ownerDocument null
```javascript
// 获取body
var body = document.body
// 标题
// 获取
var name = document.title;
// 修改
document.title = "新名字"
// 获取url
document.URL
// 获取域名
document.domain
// 获取来源
document.referrer
```
### 选择元素
- id
- class
- name
- tagname
### document.getElementById()
### document.getElementsByClassName()
### document.getElementsByTagName()
### document.getElementsByName()
## 文档写入