javascript document对象

来源:互联网 发布:mac 终端输入密码 编辑:程序博客网 时间:2024/06/04 21:16
document对象:
每一个被加载如浏览器的html文件都会成为一个document对象。
此对象可以让让我们访问和操控html页面中的所有元素。
document对象是window对象的一部分,可以使用window.document属性返回document对象的引用。

属性列表:
属性描述IEFirefoxOperaW3Cdocument.activeElement 419Yesdocument.applets 419Yesdocument.baseURI 419Yesdocument.body 41NONOdocument.cookie 419Yesdocument.doctype 419Yesdocument.documentElement 419Yesdocument.documentMode 419Yesdocument.documentURI 419Yesdocument.domain 41NONOdocument.domConfig 419Yesdocument.implementation 419Yesdocument.inputEncoding 419Yesdocument.lastModified 419Yesdocument.readyState 419Yesdocument.referrer 41NONOdocument.strictErrorChecking 419Yesdocument.title 419Yesdocument.URL 419Yes
方法列表:
方法描述IEFirefoxOperaW3CadoptNode(node)从另外一个文档返回 adapded 节点到当前文档。419Yesclose()关闭用document.open()方法打开的输出流,并显示选定的数据。419YescreateAttribute()创建一个属性节点419YescreateComment()createComment() 方法可创建注释节点。419YescreateDocumentFragment()创建空的 DocumentFragment 对象,并返回此对象。419YescreateElement()创建元素节点。419YescreateTextNode()创建文本节点。419YesgetElementsByClassName()返回带有指定名称的对象集合。419YesgetElementById()返回对拥有指定 id 的第一个对象的引用。419YesgetElementsByName()返回带有指定名称的对象集合。419YesgetElementsByTagName()返回带有指定标签名的对象集合。419YesimportNode()把一个节点从另一个文档复制到该文档以便应用。419Yesnormalize()删除空文本节点,并连接相邻节点419YesnormalizeDocument()删除空文本节点,并连接相邻节点的419Yesopen()打开一个流,以收集来自任何 document.write() 或 document.writeln() 方法的输出。419YesquerySelector()返回文档中匹配指定的CSS选择器的第一元素419YesquerySelectorAll()HTML5中引入的新方法,返回文档中匹配的CSS选择器的所有元素节点列表419YesrenameNode()重命名元素或者属性节点。419Yeswrite()向文档写 HTML 表达式 或 JavaScript 代码。419Yeswriteln()等同于write()方法,不同的是在每个表达式之后写一个换行符。419Yes
集合列表:
集合描述IEFirefoxOperaW3Call提供对文档中所有HTML元素的访问。419NOanchors返回对文档中所有Anchor对象的引用。419Yesforms返回对文档中所有Form对象引用。419Yesimages返回对文档中所有Image对象引用。419Yeslinks返回对文档中所有Area和Link对象引用。419Yes
0 0
原创粉丝点击