HTMLInputElement: capture プロパティ
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
capture
は HTMLInputElement
インターフェイスのプロパティで、 <input>
要素の capture
属性を反映します。 <input>
の file
型の場合のみ関連するこのプロパティと属性は、新しいファイルをユーザー側 (user
) または外部側 (environment
) のカメラまたはマイクから取得するかどうかを指定します。ファイルの種類は、 accept
属性で定義します。 この属性が明示的に設定されていない場合、 capture
プロパティは空文字列となります。
値
文字列です。ふつうは user
または environment
、または空文字列 (""
) です。
例
js
const inputElement = document.querySelector("avatar");
console.log(inputElement.capture); // 現在の capture 属性の値
inputElement.capture = "user"; // capture 値を設定
仕様書
Specification |
---|
HTML Media Capture # dom-htmlinputelement-capture |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
capture |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No 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.