1. 개발자를 위한 웹 기술
  2. Web API
  3. HTMLInputElement
  4. multiple

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

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 ⁨2015년 7월⁩.

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

브라우저 호환성

같이 보기

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.

AltStyle によって変換されたページ (->オリジナル) /