Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

document.links

概述

links 属性返回一个包含文档中所有具有 href 属性值的 <area> 元素 <a> 元素的集合。

语法

nodeList = document.links 

示例

var links = document.links;
for(var i = 0; i < links.length; i++) {
  var linkHref = document.createTextNode(links[i].href);
  var lineBreak = document.createElement("br");
  document.body.appendChild(linkHref);
  document.body.appendChild(lineBreak);
}

规范

DOM Level 2 HTML: links

文档标签和贡献者

 此页面的贡献者: teoli, AlexChao
 最后编辑者: AlexChao,