只有document才有document接口属性//anchors 【已经不用了】document.anchors //获取页面中所有锚点元素 由于兼容原因 该属性纸返回那些拥有name属性的a元素 而不是拥有id属性的a元素 //bodydocument.body //获取body元素//characterSet 字符document.characterSet // UTF-8 获取字符编码 //childElementCountdocument.childElementCount //只读属性 返回无符号长整型数字 表示给指定元素的子元素个数//childrendocument.children // html document是html的父级 (html是根源素)//doctype//documentElement //返回文档对象(document)的根元素的只读属性(如HTML文档的<html>元素)//domaindocument.domain //获取域名//head 获取head元素//hidden 获取该元素是否被隐藏 false是没有隐藏 //images 获取页面中所有的img标签//links 获取页面中所有的a标签//locationdocument.location // 获取一个对象 里面有当前地址、端口号、协议等等//onxxxxxxxxx 获取一系列的事件监听//origin 源//plugins documen.plugins //可以知道flash用户有没有开启插件[] 就是没有插件//readyState 查看是否下载完成//referrer 【很重要】document.referrer //引荐人//scripts 获取所有的script标签//scrollingElement 获取正在滚动的元素//styleSheets 获取所有css//title 获取页面title//visibilityState 获取页面是否被显示方法//close() 关闭文档//createDocumentFragment() 创建DocumentFragment具体用法自己看文档//createElement() 创建一个元素//createTextNode() 创建一个文本节点//execCommand() 当你想写一个父文本编辑器的时候可用//exitFullscreen() 退出全屏//getElementById() 获取id//getElementsByClassName() 获取所有xxx的class//getElementsByName() 通过名字获取//getElementsByTagName() 通过标签名获取//getSelection() 获取用过选中的文本//hasFocus() 用户光标是否在当前页面上//open() 打开//querySelector() 通过选择器获取 一个元素//querySelectorAll() 通过选择器获取 所有元素//registerElement() (目前用不到)//write() 写//writeln() 写一行要背 要背 要背 要背在标签里加text 两种方法:div1.innerText = ‘hello ’ //这种会有问题div.appendChild( document.createTextNode(‘hello world’) ) // 很安全