Ele.attrbutes将返回一个NamedNodeMap对象,即NamedNodeMap存储的是元素的“特性Attribute”集合。而集合中的每一个元素,都是Attr类型的对象。

html:

    <ul id="box" data-url="index.html" node-action="submit">
<li>节点一</li>
<li>节点二</li>
<li>节点三</li>
</ul>

JS:

    var box = document.getElementById("box");
var attrs = box.attributes;
console.log(attrs);
console.log(attrs.length);
console.log(attrs[0]);
console.log(attrs.item(1));

结果如下:

最新文章

  1. 【转】超实用的JavaScript技巧及最佳实践
  2. 如何清除swap里的文件
  3. editplus bat语法高亮
  4. URL是什么?
  5. Windows下OpenCV的环境配置
  6. 4.关于phpstudy for linux 的安装(LNMP)更好的环境请看8.LNMP环境
  7. 全文索引--自定义chinese_lexer词典
  8. Java学习笔记(1)——基本数据类型
  9. Mac 安装Qt5.1编译出现的错误解决
  10. Android开发技巧——PagerAdapter再简单的包
  11. Sublime Text3 使用手册
  12. Oracle通过SCN做增量备份修复DG
  13. 剑指offer(13)
  14. The missing package manager for macOS (or Linux)
  15. iOS 弹幕制作
  16. 18.4 #if 0…endif的用途
  17. what&#39;s the 单例模式
  18. HDU 3970 Harmonious Set 容斥欧拉函数
  19. 文件读取ndarry 等价于DataFrame的操作
  20. ubuntu16更新源

热门文章

  1. A - Packets 贪心
  2. windows通过node环境搭建安装npm,cnpm,vue-cli
  3. 修改CentOS默认yum源为国内yum镜像源
  4. 【适合核显电脑的环境配置】Tensorflow教程-Windows 10下安装tensorflow CPU with Anaconda
  5. 【转】Windows中设置Fiddler抓HTTPS请求的解决办法 Unable to configure Windows to Trust the Fiddler Root certificate .
  6. 【vue】vue +element prop用法
  7. ESP8266烧录配置
  8. 在flask中使用swagger(flasgger使用方法及效果展示)
  9. Spring MVC 5 + Thymeleaf 基于Java配置和注解配置
  10. python 获取gearbest地址库代码