HTMLInputElement: capture プロパティ

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

captureHTMLInputElement インターフェイスのプロパティで、 <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 GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
capture

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

関連情報