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

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support YesEdge Full support YesFirefox Full support 3.6IE ? Opera ? Safari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown

Document Tags and Contributors

Contributors to this page: fscholz, Delapouite, SmokeyPHP, teoli, kscarfone, nehasharma, Sheppy, Crash
Last updated by: fscholz,