From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../web/api/htmlinputelement/multiple/index.html | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 files/ja/web/api/htmlinputelement/multiple/index.html (limited to 'files/ja/web/api/htmlinputelement/multiple/index.html') diff --git a/files/ja/web/api/htmlinputelement/multiple/index.html b/files/ja/web/api/htmlinputelement/multiple/index.html new file mode 100644 index 0000000000..a95fa672b3 --- /dev/null +++ b/files/ja/web/api/htmlinputelement/multiple/index.html @@ -0,0 +1,38 @@ +--- +title: HTMLInputElement.multiple +slug: Web/API/HTMLInputElement/multiple +translation_of: Web/API/HTMLInputElement/multiple +--- +
{{ APIRef("HTML DOM") }}
+ +

HTMLInputElement.multipleinputタグが複数の値を持つことができるかどうかを示すプロパティです。現在Firefoxでは、multiple属性は<input type="file">でのみサポートされています。

+ +

+ +
// fileInputは<input type=file multiple>であるようなHTML要素です
+var fileInput = document.getElementById("myfileinput");
+
+if (fileInput.multiple == true) {
+
+    for (var i = 0, len = fileInput.files.length; i < len; i++) {
+        // fileInput.filesをループ
+    }
+
+// 一つのファイルのみが有効な場合
+} else {
+    var file = fileInput.files.item(0);
+}
+
+ +

関連情報

+ + + +

仕様

+ + -- cgit v1.2.3-54-g00ecf