JS DOM1核心概要document

Document类型:

document对象表示整个html页面,而且,document对象是window对象的一个属性;

文档信息:document.title,表示当前页面的标题;

              document.url,表示当前页面的链接地址;

              document.domain表示当前页面的域名;

              document.referrer表示当前页面的来源页面;

查找元素:document.getElementById(),返回节点元素;

              document.getElementByTagName(),返回一个nodelist节点集,通过方括号语法访问其中某一个元素;

特殊集合:document.anchors,表示所有带name属性的a元素;

              document.forms,包含文档中所有forms元素;

              document.images,包含文档中所有image元素;

              document.links包含文档中所有带href属性的a元素;

文档写入:document.write/writeln;向文档中输出文档流;

              document.colse/open;关闭或者打开文档流;

          

              

原文地址:https://www.cnblogs.com/lvlina/p/5885459.html