0x01 Document对象
当浏览器载入一个HTML文档时,它就变成了document对象。
document对象是window对象的属性,可以用window.document来访问
0x02 常用对象属性
document.baseURI
返回网页的绝对URL(IE不支持)document.URL
返回网页的URLdocument.cookie
返回cookiedocument.body
返回文档body元素docuemnt.referrer
返回载入当前文档的文档的 URLdocument.location
返回当前文档的URL
0x03 常用对象方法
document.write()
向文档中写东西document.writeln()
跟document.write()一个功能,只不过每次写的时候都会加一个\ndocument.attachEvent()
事件绑定,仅支持IE浏览器document.addEventListener()
事件绑定,支持所有浏览器document.execCommand()
处理HTML数据document.open()
打开一个输出流,用来收集document.write()和document.writeln()的输出的内容

