Skip to content

使用input标签上传图片时,怎样触发默认拍照功能?

参考答案:

capture 属性用于指定文件上传控件中媒体拍摄的方式。

可选值:

  • user 前置
  • environment 后置
  • camera 相机
  • camcorder 摄像机
  • microphone 录音
html
<input type='file' accept='image/*;' capture='camera'>