Movatterモバイル変換


[0]ホーム

URL:


  1. 開発者向けのウェブ技術
  2. Web API
  3. HTMLInputElement
  4. multiple

このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docsコミュニティーについてもっと知り、仲間になるにはこちらから。

View in EnglishAlways switch to English

HTMLInputElement: multiple プロパティ

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 では、multiple<input type="file"> でのみ対応しています。

論理値です。

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 byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp