调用手机的相机
<input type="file" accept="image/*" capture="camera">
第二个input 调用的是相册或者相机
<input type="file" accept="image/*" >
吧上传的图片显示在桌面
<body> <input type="file" id="file_input" name="img" /> <img id="showimg"> <script type="text/javascript"> var showimg = document.getElementById("showimg"); var imginput = document.getElementById("file_input"); imginput.onchange = function () { var files = this.files; var url = URL.createObjectURL(files[0]); showimg.src=url; } </script> </body>