Linux 拨号vps windows公众号手机端

JS document对象的属性有哪些

lewis 6年前 (2019-02-12) 阅读数 14 #程序编程
文章标签 js

JS document对象的属性有以下一些常见属性:

  1. document.documentElement:代表整个文档的根元素(一般是元素)。

  2. document.body:代表文档的元素。

  3. document.title:代表文档的标题。

  4. document.cookie:代表文档的cookie。

  5. document.domain:代表文档的域名。

  6. document.head:代表文档的元素。

  7. document.location:代表文档的URL信息。

  8. document.referrer:代表文档的引用页面的URL。

  9. document.forms:代表文档中所有的元素集合。

  10. document.images:代表文档中所有的元素集合。

  11. document.links:代表文档中所有的元素和元素集合。

  12. document.scripts:代表文档中所有的元素集合。

  13. document.styleSheets:代表文档中所有的样式表对象集合。

  14. document.documentElement.scrollTop:代表文档滚动条的垂直位置。

  15. document.documentElement.scrollLeft:代表文档滚动条的水平位置。

此外,document对象还有一些方法,如getElementById()、getElementsByClassName()、getElementsByTagName()等。

版权声明

本文仅代表作者观点,不代表米安网络立场。

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

热门