diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/api/htmlinputelement/multiple/index.html | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/ja/web/api/htmlinputelement/multiple/index.html')
-rw-r--r-- | files/ja/web/api/htmlinputelement/multiple/index.html | 38 |
1 files changed, 38 insertions, 0 deletions
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 +--- +<div>{{ APIRef("HTML DOM") }}</div> + +<p><strong><code>HTMLInputElement.multiple</code></strong>は<code>input</code>タグが複数の値を持つことができるかどうかを示すプロパティです。現在Firefoxでは、<strong>multiple</strong>属性は<code><input type="file"></code>でのみサポートされています。</p> + +<h2 id="例">例</h2> + +<pre class="brush:js">// 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); +} +</pre> + +<h2 id="関連情報">関連情報</h2> + +<ul> + <li><a href="/en/DOM/FileList" title="en/DOM/FileList">FileList</a></li> + <li><a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=523771" title="https://bugzilla.mozilla.org/show_bug.cgi?id=523771">Bug 523771</a> - <span class="bz_default_hidden" id="summary_alias_container" style="display: inline;"> <span id="short_desc_nonedit_display">Support <input type=file multiple></span> </span></li> +</ul> + +<h2 id="仕様">仕様</h2> + +<ul> + <li><a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/common-input-element-attributes.html#attr-input-multiple" title="http://www.whatwg.org/specs/web-apps/current-work/multipage/common-input-element-attributes.html#attr-input-multiple">The multiple attribute</a> (HTML 5 working draft)</li> +</ul> |