From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/api/document/links/index.html | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 files/ja/web/api/document/links/index.html (limited to 'files/ja/web/api/document/links/index.html') diff --git a/files/ja/web/api/document/links/index.html b/files/ja/web/api/document/links/index.html new file mode 100644 index 0000000000..6394b176a6 --- /dev/null +++ b/files/ja/web/api/document/links/index.html @@ -0,0 +1,31 @@ +--- +title: document.links +slug: Web/API/Document/links +tags: + - DOM + - Document + - Gecko + - Gecko DOM Reference +translation_of: Web/API/Document/links +--- +
+ {{ApiRef}}
+

概要

+

links プロパティは、文書中の、 href 属性の値を持つすべての {{htmlelement("area")}} 要素とアンカー要素のコレクションを返します。

+

構文

+
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);
+}
+

仕様書

+ -- cgit v1.2.3-54-g00ecf