先是要如何判断安卓与ios var u = navigator.userAgent; var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端 var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端 if (isAndroid) { }else if (isiOS) { } 1、使用input file调取摄像头与相册 <input type="file" class="input" id="inputCamera" capture="camera"> ①安卓调取相机 var a = document.getElementById('inputCamera') a.setAttribute("accept", "image/*"); ②安卓调取相册 var a = document.getElementById('inputPhoto') a.setAttribute("capture", "camera"); ③ios调取相机 var a = document.getElementById('inputCamera') a.setAttribute(&#