Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. HTMLInputElement
  4. capture

HTMLInputElement: capture property

Limited availability

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

Thecapture property of theHTMLInputElement interface reflects the<input> element'scapture attribute. Only relevant to the<input> of typefile, the property and attribute specify whether, a new file should be captured from a user-facing (user) or outward facing (environment) camera or microphone. The type of file is defined theaccept attribute. If the attribute is not explicitly set, thecapture property is an empty string.

Value

A string; generally eitheruser orenvironment, or an empty string ("").

Example

js
const inputElement = document.querySelector("avatar");console.log(inputElement.capture); // the current value of the capture attributeinputElement.capture = "user"; // sets the capture value

Specifications

Specification
HTML Media Capture
# dom-htmlinputelement-capture

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp