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/images/index.html | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 files/ja/web/api/document/images/index.html (limited to 'files/ja/web/api/document/images/index.html') diff --git a/files/ja/web/api/document/images/index.html b/files/ja/web/api/document/images/index.html new file mode 100644 index 0000000000..15835ddf89 --- /dev/null +++ b/files/ja/web/api/document/images/index.html @@ -0,0 +1,38 @@ +--- +title: document.images +slug: Web/API/Document/images +tags: + - DOM + - Document + - Gecko + - Gecko DOM Reference +translation_of: Web/API/Document/images +--- +
+ {{ApiRef}}
+

概要

+

document.images は、現在の HTML 文書の {{domxref("Image")}} のコレクションを返します。

+

構文

+
var htmlCollection = document.images;
+

+

特定の src 属性値を持つ img 要素が文書中に存在する場合にのみ何らかの処理を行う例を以下に示します。

+
var ilist = document.images;
+
+for(var i = 0; i < ilist.length; i++) {
+    if(ilist[i].src == "banner.gif") {
+        // bunner.gif が存在した場合の処理
+    }
+}
+

プロパティ

+
+
+ document.images.length
+
+ 文書中の画像の数を返す
+
+

注記

+

document.images は DOM HTML の一部であり、HTML 文書に於いてのみ動作します。

+

仕様書

+ -- cgit v1.2.3-54-g00ecf