Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

HTMLInputElement.multiple

我们的志愿者还没有将这篇文章翻译为 中文 (简体)加入我们帮助完成翻译!

The HTMLInputElement.multiple property indicates if an input can have more than one value. Firefox currently only supports multiple for <input type="file">.

Example

// fileInput is a <input type=file multiple>
var fileInput = document.getElementById("myfileinput");

if (fileInput.multiple == true) {

    for (var i = 0, len = fileInput.files.length; i < len; i++) {
        // loop fileInput.files
    }

// only one file available
} else {
    var file = fileInput.files.item(0);
}

See Also

Specification

文档标签和贡献者

 此页面的贡献者: fscholz, Delapouite, SmokeyPHP, teoli, kscarfone, nehasharma, Sheppy, Crash
 最后编辑者: fscholz,