aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/htmlinputelement/multiple/index.html
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/htmlinputelement/multiple/index.html
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/api/htmlinputelement/multiple/index.html')
-rw-r--r--files/zh-cn/web/api/htmlinputelement/multiple/index.html44
1 files changed, 44 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/htmlinputelement/multiple/index.html b/files/zh-cn/web/api/htmlinputelement/multiple/index.html
new file mode 100644
index 0000000000..937c52a93f
--- /dev/null
+++ b/files/zh-cn/web/api/htmlinputelement/multiple/index.html
@@ -0,0 +1,44 @@
+---
+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> 属性表示一个input是否可以有多个值。目前只有火狐支持 <code>&lt;input type="file"&gt;</code>存有多个值。</p>
+
+<h2 id="实例">实例</h2>
+
+<pre class="brush:js">// fileInput is a &lt;input type=file multiple&gt;
+let fileInput = document.getElementById('myfileinput');
+
+if (fileInput.multiple == true) {
+
+ for (let i = 0; i &lt; fileInput.files.length; i++) {
+ // Loop fileInput.files
+ }
+
+// Only one file available
+} else {
+ let file = fileInput.files.item(0);
+}
+</pre>
+
+<h2 id="See_also">See also</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 &lt;input type=file multiple&gt;</span> </span></li>
+</ul>
+
+<h2 id="Specification">Specification</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>
+
+<h2 id="Browser_compatibility">Browser compatibility</h2>
+
+
+
+<p>{{Compat("api.HTMLInputElement.multiple")}}</p>