Movatterモバイル変換


[0]ホーム

URL:


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

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

View in EnglishAlways switch to English

HTMLInputElement: accept プロパティ

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月.

acceptHTMLInputElement インターフェイスのプロパティで、<input> 要素のaccept 属性を反映し、一般にカンマで区切られた固有ファイル型指定子のリストで、<input>fileに期待されるファイル型のヒントを提供します。この属性が明示的に設定されていない場合、accept 属性は空文字列になります。

要素のaccept 値を表す文字列、またはaccept が明示的に設定されていない場合は空文字列。

js
const inputElement = document.querySelector("#time");console.log(inputElement.accept); // accept 属性の現在の値inputElement.accept = ".doc,.docx,.xml,application/msword"; // accept 値を設定

仕様書

Specification
HTML
# dom-input-accept

ブラウザーの互換性

関連情報

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp