android
<input type="file" accept="image/*" multiple/>
IOS
<input type="file" accept="image/*;capture=camera" multiple/>
<!--调用相机-->
<input type="file" accept="image/*" capture="camera" />
<!--调用摄像-->
<input type="file" accepet="video/*" capture="camcorder" />
<!--调用录音-->
<input type="file" accept="audio/*" capture="microphone" />
accept表示可以打开的系统文件目录,capture表示可以捕获到的系统默认的设备。
其中,还有一个属性multiple,支持多选,当支持多选时,multiple优先级高于capture,所以只需要写成:
<input type="file" accept="image/*" multiple />
扩展阅读:
https://blog.csdn.net/jeffkxt/article/details/80472596
https://blog.csdn.net/yzzane/article/details/78642219
https://blog.csdn.net/lin_shuaixin/article/details/74517050
https://blog.csdn.net/u012054869/article/details/81669739