HTMLInputElement: multiple property
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
HTMLInputElement.multiple
속성은 입력이 여러 개의 값을 가질 수 있는지 여부를 나타냅니다. 현재 Firefox는 <input type="file">
에 대해서만 multiple
을 지원합니다.
값
불리언 값입니다.
예제
js
// fileInput 은 <input type=file multiple> 입니다.
let fileInput = document.getElementById("myfileinput");
if (fileInput.multiple) {
// fileInput.files를 순회합니다.
for (const file of fileInput.files) {
// 하나의 파일에 대한 작업을 수행합니다.
}
// 파일이 하나만 있는 경우
} else {
let [file] = fileInput.files;
}
명세서
Specification |
---|
HTML # dom-input-multiple |
브라우저 호환성
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
multiple |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
같이 보기
- FileList
- Bug 523771 - <input type=file multiple> 지원